feat: add keybinding for 'jj' in insert mode to <Esc>

This commit is contained in:
David Drottson 2024-03-18 08:42:44 +01:00
parent 63ed116909
commit 0a874fe0c4
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,9 @@ vim.opt.scrolloff = 10
vim.opt.hlsearch = true vim.opt.hlsearch = true
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Set key combination for escape in insert mode
vim.keymap.set('i', 'jj', '<Esc>', {})
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })