local map = vim.keymap.set -- Create split panes using leader key map('n', 'sh', ':split') map('n', 'sv', ':vsplit') -- Clear highlights on search when pressing in normal mode map('n', '', 'nohlsearch') -- Diagnostic keymaps map('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Cycle through buffers map('n', '', ':bnext') map('n', '', ':bprevious') -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- to remember. map('t', '', '', { desc = 'Exit terminal mode' }) -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows -- -- See `:help wincmd` for a list of all window commands map('n', '', '', { desc = 'Move focus to the left window' }) map('n', '', '', { desc = 'Move focus to the right window' }) map('n', '', '', { desc = 'Move focus to the lower window' }) map('n', '', '', { desc = 'Move focus to the upper window' }) -- Delete the current buffer vim.keymap.set('n', 'bd', 'bdelete', { desc = 'Delete current buffer' }) -- Force delete the current buffer (discard changes) vim.keymap.set('n', 'bD', 'bdelete!', { desc = 'Force delete current buffer' }) -- Delete all buffers except the current one vim.keymap.set('n', 'ba', ':%bd|e#', { desc = 'Delete all other buffers' })