From 5448d344c328c3eedc4873ce3d7138d9e9660b2b Mon Sep 17 00:00:00 2001 From: Dynocoder Date: Thu, 6 Jun 2024 23:49:48 -0400 Subject: [PATCH] removed vim-sleuth, update snippet selection keymaps --- init.lua | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 5b74c834..4233bb80 100644 --- a/init.lua +++ b/init.lua @@ -118,13 +118,18 @@ vim.opt.scrolloff = 999 vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') +-- tab and indent spacing +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 + -- vim move line commands vim.keymap.set('v', 'J', ":m '>+1gv=gv") vim.keymap.set('v', 'K', ":m '<-2gv=gv") -- setup command for ctrl-backspace - delete whole word -- vim.api.nvim_set_keymap('i', '', '', { noremap = true, silent = true }) -vim.keymap.set('i', '', '', { noremap = true, silent = false }) +-- vim.keymap.set('i', '', '', { noremap = true, silent = false }) -- replace the current word vim.keymap.set('n', 'rw', [[:%s/\<\>//gI]]) @@ -194,7 +199,7 @@ vim.opt.rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + -- 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following @@ -351,7 +356,7 @@ require('lazy').setup({ vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sb', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'sb', builtin.buffers, { desc = '[S] Find existing [B]uffers' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', 'c/', function() @@ -689,9 +694,9 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), + -- [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), + -- [''] = cmp.mapping.select_prev_item(), -- Scroll the documentation window [b]ack / [f]orward [''] = cmp.mapping.scroll_docs(-4), @@ -700,13 +705,13 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + -- [''] = cmp.mapping.confirm { select = true }, -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display