Skip to content

Commit

Permalink
better j/k
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Suraci <[email protected]>
  • Loading branch information
vito committed May 23, 2024
1 parent 8478b30 commit 887773a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/custom/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
vim.keymap.set('i', 'jk', '<Esc>', { desc = 'Escape with jk', noremap = true, silent = true })
vim.keymap.set('i', 'kj', '<Esc>', { desc = 'Escape with kj', noremap = true, silent = true })

-- move by visual line, not actual line (i.e. wrapping)
vim.keymap.set('n', 'j', 'gj', { desc = 'Move down visual line', noremap = true, silent = true })
vim.keymap.set('n', 'k', 'gk', { desc = 'Move up visual line', noremap = true, silent = true })

-- save on enter
vim.keymap.set('n', '<CR>', function()
if vim.api.nvim_buf_get_option(0, 'buftype') == 'quickfix' then
Expand Down

0 comments on commit 887773a

Please sign in to comment.