From f7eda76c6e37a9b27428eca3ae4e497e20a0b69f Mon Sep 17 00:00:00 2001 From: long Date: Sun, 9 Oct 2022 07:09:08 -0500 Subject: [PATCH] junk removal --- init.lua | 2 +- lua/config.lua | 17 +++--- lua/keybinds.lua | 140 ++++++++--------------------------------------- lua/plugins.lua | 24 +------- 4 files changed, 37 insertions(+), 146 deletions(-) diff --git a/init.lua b/init.lua index 7b8893d..408b495 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ require("packer_check") require("plugins") require("config") require("keybinds") -require("save_buffer_position") +--require("save_buffer_position") require("lsp") --local theme = vim.env.LIGHTMODE == "1" and "onehalflight" or "onedark" diff --git a/lua/config.lua b/lua/config.lua index 339c1eb..af5398e 100644 --- a/lua/config.lua +++ b/lua/config.lua @@ -2,7 +2,8 @@ vim.cmd([[au BufRead,BufNewFile .env.* set filetype=sh]]) -- Dockerfile file highlighting vim.cmd([[au BufRead,BufNewFile Dockerfile.* set filetype=dockerfile]]) -vim.cmd([[au BufWrite * normal zx]]) +-- redo folds on write +--vim.cmd([[au BufWrite * normal zx]]) -- jinja highlighting vim.cmd([[au BufRead,BufNewFile *.jinja set filetype=html]]) @@ -63,6 +64,8 @@ end opt.termguicolors = false +vim.cmd([[hi CursorLine cterm=NONE ctermbg=darkgray ctermfg=white]]) + ----------------------------------------------------- -- DISABLE HIGHLIGHT OUTSIDE OF SEARCH AND REPLACE -- ----------------------------------------------------- @@ -79,12 +82,12 @@ opt.termguicolors = false --------------- -- PROVIDERS -- --------------- -local pyenv_root = vim.env.PYENV_ROOT -if pyenv_root ~= nil then - g.python3_host_prog = pyenv_root .. "/shims/python3" -else - g.python3_host_prog = "/usr/bin/python3" -end +--local pyenv_root = vim.env.PYENV_ROOT +--if pyenv_root ~= nil then +-- g.python3_host_prog = pyenv_root .. "/shims/python3" +--else +-- g.python3_host_prog = "/usr/bin/python3" +--end ------------------ -- ONEDARK.NVIM -- diff --git a/lua/keybinds.lua b/lua/keybinds.lua index 2698377..7f19229 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -13,14 +13,15 @@ end vim.g.mapleader = "," map("v", "", '"+y') ---map("n", "", ":bnext") ---map("n", "", ":bprevious") -map("n", "", ":lua harpoon_bnext()") -map("n", "", ":lua harpoon_bprevious()") ---map("n", "", ":noh", { silent = true }) --After searching, pressing escape stops the highlight +map("n", "", ":bnext") +map("n", "", ":bprevious") +--map("n", "", ":lua harpoon_bnext()") +--map("n", "", ":lua harpoon_bprevious()") +map("n", "", ":noh", { silent = true }) --After searching, pressing escape stops the highlight ---map("n", "w", [[:%s/\s\+$//e]]) +map("n", "w", [[:%s/\s\+$//e]]) --map("n", "x", ":Bclose ") +map("n", "x", ":bp|bd #") map("n", "t", ":tabnew") -- Move split @@ -29,27 +30,17 @@ map("n", "", "") map("n", "", "") map("n", "", "") ---map("n", "", "") ---map("n", "", "") ---map("n", "", "") ---map("n", "", "") - -- Split navigations map("n", "", "") map("n", "", "") map("n", "", "") map("n", "", "") ---map("n", "", "") ---map("n", "", "") ---map("n", "", "") ---map("n", "", "") - -- Resize split ---map("n", "-", "-") ---map("n", "+", "+") ---map("n", "(", "<") ---map("n", ")", ">") +map("n", "-", "-") +map("n", "+", "+") +map("n", "(", "<") +map("n", ")", ">") -- Scroll viewport map("n", "", "") @@ -58,24 +49,15 @@ map("v", "", "") map("v", "", "") map("i", "", "") map("i", "", "") ---map("n", "", "") ---map("n", "", "") ---map("v", "", "") ---map("v", "", "") ---map("i", "", "") ---map("i", "", "") -- Make visual yanks place the cursor back where started map("v", "y", "ygv") --- map Enter to switch tabs ---map("n", "", ":tabnext") ---map("n", "", ":tabprevious") - -- Terminal binds -map("t", "", [[]]) -map("n", [[\]], ':split | term') -map("n", [[|]], ':vsplit | term') +local term_command = "split | set norelativenumber | set nonumber | term" +map("t", "", [[]]) +map("n", [[\]], ":" .. term_command .. "") +map("n", [[|]], ":v" .. term_command .. "") --------- -- HOP -- @@ -84,74 +66,15 @@ local hop_opts = "{ create_hl_autocmd = true }" local hopword = [[lua require'hop'.hint_words(]] .. hop_opts .. [[)]] local hopline = [[lua require'hop'.hint_lines_skip_whitespace(]] .. hop_opts .. [[)]] ---map("n", "", hopline, {silent = true}) ---map("v", "", hopline, {silent = true}) ---map("n", "", hopword, {silent = true}) ---map("v", "", hopword, {silent = true}) - map("n", "W", hopline, { silent = true }) map("v", "W", hopline, { silent = true }) map("n", "w", hopword, { silent = true }) map("v", "w", hopword, { silent = true }) --- args: direction: bool, inclusive: bool --- inclusive is broken in hop as of this comment ---local hop_hint_char1 = function(args) --- local direction = args.forward and "AFTER_CURSOR" or "BEFORE_CURSOR" --- local inclusive = args.inclusive and "true" or "false" --- --- return ("lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection." .. --- direction .. ", current_line_only = true, inclusive_jump = " .. inclusive .. " })") ---end --- ---vim.api.nvim_set_keymap("", "f", hop_hint_char1({forward = true, inclusive = false}), {}) ---vim.api.nvim_set_keymap("", "F", hop_hint_char1({forward = false, inclusive = false}), {}) ---vim.api.nvim_set_keymap("", "t", hop_hint_char1({forward = true, inclusive = false}), {}) ---vim.api.nvim_set_keymap("", "T", hop_hint_char1({forward = false, inclusive = false}), {}) - --- place this in one of your configuration file(s) ---vim.api.nvim_set_keymap( --- "n", --- "f", --- "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })", --- {} ---) ---vim.api.nvim_set_keymap( --- "n", --- "F", --- "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })", --- {} ---) ---vim.api.nvim_set_keymap( --- "", --- "f", --- "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, inclusive_jump = true })", --- {} ---) ---vim.api.nvim_set_keymap( --- "", --- "F", --- "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, inclusive_jump = true })", --- {} ---) ---vim.api.nvim_set_keymap( --- "", --- "t", --- "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })", --- {} ---) ---vim.api.nvim_set_keymap( --- "", --- "T", --- "lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })", --- {} ---) - --------- -- FZF -- --------- map("n", "o", ":Files") ---map("n", "O", [[:lua vim.fn['fzf#vim#files']('~/')]]) map("n", "O", ":Files ~/") map("n", "p", ":Buffers") map("n", "h", ":Helptags") @@ -160,7 +83,6 @@ map("n", "c", ":Commands") map("n", "r", ":Rg ") map("n", "R", ":Rg") map("n", "s", ":Lines") ---map("n", "[", ":Windows ") map("n", "gf", ":GFiles") map("n", "gn", ":GFiles?") @@ -171,42 +93,26 @@ map("n", "gc", ":Commits") ------------------ map("n", "gb", ":GBranches") ---------- --- ALE -- ---------- ---map("n", "", ":ALEPreviousWrap ", {silent = true}) ---map("n", "", ":ALENextWrap ", {silent = true}) ---map("n", "f", ":ALEFix", {silent = true}) - ------------- -- HARPOON -- ------------- --map("n", "m", [[:lua require("harpoon.mark").add_file() ]]) -map("n", "x", ":lua harpoon_rm_file()") -map("n", "ma", [[:lua harpoon_toggle_file()]]) -map("n", "mc", [[:lua harpoon_clear_all()]]) -map("n", "ml", [[:lua require("harpoon.ui").toggle_quick_menu()]]) -map("n", "mt", [[:lua harpoon_btoggle()]]) +--map("n", "x", ":lua harpoon_rm_file()") +--map("n", "ma", [[:lua harpoon_toggle_file()]]) +--map("n", "mc", [[:lua harpoon_clear_all()]]) +--map("n", "ml", [[:lua require("harpoon.ui").toggle_quick_menu()]]) +--map("n", "mt", [[:lua harpoon_btoggle()]]) --map("n", "n", [[:lua require("harpoon.ui").nav_next() ]]) --map("n", "N", [[:lua require("harpoon.ui").nav_prev() ]]) ------------ --- CODEX -- ------------ ---local create_completion = ":lua vim.fn.CreateCompletion(200)" ---local create_completion = ":lua vim.fn.CreateCompletionLine()" ---map("n", "", create_completion) ---map("i", "", ("" .. create_completion)) ---map("i", "", "liul:CreateCompletion") - -------------- -- NVIM FZF -- -------------- -map("n", "mm", [[:lua fzf_buffer_add_to_harpoon()]]) -map("n", "mo", [[:lua fzf_files_to_harpoon()]]) -map("n", "ml", [[:lua fzf_select_harpoon_mark()]]) +--map("n", "mm", [[:lua fzf_buffer_add_to_harpoon()]]) +--map("n", "mo", [[:lua fzf_files_to_harpoon()]]) +--map("n", "ml", [[:lua fzf_select_harpoon_mark()]]) -- RNVIMR -- https://github.com/kevinhwang91/rnvimr diff --git a/lua/plugins.lua b/lua/plugins.lua index 0b50afa..faab57c 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,6 +1,6 @@ -local use = require("packer").use - require("packer").startup(function() + local use = require("packer").use + use("wbthomason/packer.nvim") -- OPENAI CODEX @@ -29,8 +29,6 @@ require("packer").startup(function() -- FILE MANAGEMENT use("junegunn/fzf") use("junegunn/fzf.vim") - use("rbgrouleff/bclose.vim") - --use("francoiscabrol/ranger.vim") use("kevinhwang91/rnvimr") use("vijaymarupudi/nvim-fzf") use("vijaymarupudi/nvim-fzf-commands") @@ -48,10 +46,6 @@ require("packer").startup(function() -- EDITOR use("windwp/nvim-autopairs") - --use "jiangmiao/auto-pairs" - --use "dense-analysis/ale" - --use "nathanmsmith/nvim-ale-diagnostic" - use("turbio/bracey.vim") use("lukas-reineke/indent-blankline.nvim") --use "sheerun/vim-polyglot" @@ -61,7 +55,6 @@ require("packer").startup(function() -- LSP use("hrsh7th/nvim-cmp") -- Autocompletion plugin - --use "saadparwaiz1/cmp_luasnip" -- Snippets source for nvim-cmp use("p00f/nvim-ts-rainbow") use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }) use("nvim-treesitter/nvim-treesitter-context") @@ -85,12 +78,10 @@ require("packer").startup(function() use("chemzqm/vim-jsx-improve") use("yuezk/vim-js") -- js use("maxmellon/vim-jsx-pretty") -- react/tsx syntax highlight & indent - --use "leafOfTree/vim-vue-plugin" -- vue syntax highlight & indent -- PYTHON --use {"numirias/semshi", run = ":UpdateRemotePlugins"} -- python - use("Vimjas/vim-python-pep8-indent") - --use("petobens/poet-v") + --use("Vimjas/vim-python-pep8-indent") -- HTML/CSS use("mattn/emmet-vim") @@ -104,15 +95,6 @@ require("packer").startup(function() }) end, }) - --use({ - -- "olimorris/persisted.nvim", - -- config = function() - -- require("persisted").setup({ - -- use_git_branch = true, - -- autoload = true, - -- }) - -- end, - --}) -- ZIG use("ziglang/zig.vim")