diff --git a/keymaps.lua b/keymaps.lua index ca7abcca..f1d46a8a 100644 --- a/keymaps.lua +++ b/keymaps.lua @@ -28,3 +28,31 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the left wind vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) + +-- Enable moving highlighted lines +vim.keymap.set('v', 'J', ":m '>+1gv=gv") +vim.keymap.set('v', 'K', ":m '<-2gv=gv") + +-- Open file tree +vim.keymap.set('n', 'pv', vim.cmd.Ex) + +-- Keep cursor in place when appending next line +vim.keymap.set('n', 'J', 'mzJ`z') + +-- Keep highlighted search term in the center of the screen +vim.keymap.set('n', 'n', 'nzzzv') +vim.keymap.set('n', 'N', 'Nzzzv') + +-- Replace highlighted text with yanked one +vim.keymap.set('x', 'p', '"_dP') + +-- Make sure yanking works with d +vim.keymap.set('n', 'd', '"_d') +vim.keymap.set('v', 'd', '"_d') + +vim.keymap.set('n', '', 'cnextzz') +vim.keymap.set('n', '', 'cprevzz') +vim.keymap.set('n', 'k', 'lnextzz') +vim.keymap.set('n', 'j', 'lprevzz') + +vim.keymap.set('n', 'g', [[:%s/\<\>//gI]]) diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua index f4aa12ca..41fa0b71 100644 --- a/lua/custom/plugins/harpoon.lua +++ b/lua/custom/plugins/harpoon.lua @@ -33,16 +33,16 @@ return { vim.keymap.set('n', 'a', function() harpoon:list():add() end) - vim.keymap.set('n', '', function() + vim.keymap.set('n', '1', function() harpoon:list():select(1) end) - vim.keymap.set('n', '', function() + vim.keymap.set('n', '2', function() harpoon:list():select(2) end) - vim.keymap.set('n', '', function() + vim.keymap.set('n', '3', function() harpoon:list():select(3) end) - vim.keymap.set('n', '', function() + vim.keymap.set('n', '4', function() harpoon:list():select(4) end) diff --git a/set.lua b/set.lua index 628799a1..7942d1aa 100644 --- a/set.lua +++ b/set.lua @@ -11,7 +11,7 @@ vim.opt.relativenumber = true vim.opt.termguicolors = true -vim.opt.updatetime = 750 +vim.opt.updatetime = 50 vim.opt.colorcolumn = '100'