diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 1b7561a..b46ffae 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -60,4 +60,27 @@ vim.keymap.set('v', '', 'MoveBlock(-1)') vim.keymap.set('v', '', 'MoveHBlock(-1)') vim.keymap.set('v', '', 'MoveHBlock(1)') +-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n +vim.keymap.set('n', 'n', "'Nn'[v:searchforward].'zv'", { expr = true, desc = 'Next Search Result' }) +vim.keymap.set('x', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next Search Result' }) +vim.keymap.set('o', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next Search Result' }) +vim.keymap.set('n', 'N', "'nN'[v:searchforward].'zv'", { expr = true, desc = 'Prev Search Result' }) +vim.keymap.set('x', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev Search Result' }) +vim.keymap.set('o', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev Search Result' }) + +-- Buffers +vim.keymap.set('n', '', 'bprevious', { desc = 'Prev Buffer' }) +vim.keymap.set('n', '', 'bnext', { desc = 'Next Buffer' }) +vim.keymap.set('n', 'bb', 'e #', { desc = 'Switch to Other Buffer' }) +vim.keymap.set('n', 'bD', ':bd', { desc = 'Delete Buffer and Window' }) + +-- Tabs +vim.keymap.set('n', 'l', 'tablast', { desc = 'Last Tab' }) +vim.keymap.set('n', 'o', 'tabonly', { desc = 'Close Other Tabs' }) +vim.keymap.set('n', 'f', 'tabfirst', { desc = 'First Tab' }) +vim.keymap.set('n', '', 'tabnew', { desc = 'New Tab' }) +vim.keymap.set('n', 'd', 'tabclose', { desc = 'Close Tab' }) +vim.keymap.set('n', ']', 'tabnext', { desc = 'Next Tab' }) +vim.keymap.set('n', '[', 'tabprevious', { desc = 'Previous Tab' }) + -- vim: ts=2 sts=2 sw=2 et