vim.api.nvim_set_keymap('i', 'jj', '', { noremap = false }) -- buffers vim.api.nvim_set_keymap('n', 'bk', ':blast', { desc = 'Buffer: Last', noremap = false }) vim.api.nvim_set_keymap('n', 'bj', ':bfirst', { desc = 'Buffer: First', noremap = false }) vim.api.nvim_set_keymap('n', 'bh', ':bprev', { desc = 'Buffer: Prev', noremap = false }) vim.api.nvim_set_keymap('n', 'bl', ':bnext', { desc = 'Buffer: Next', noremap = false }) vim.api.nvim_set_keymap('n', 'bd', ':Bdelete', { desc = 'Buffer: Delete', noremap = false }) vim.api.nvim_set_keymap('n', 'bw', ':Bwipeout', { desc = 'Buffer: Wipeout', noremap = false }) -- files vim.api.nvim_set_keymap('n', 'QQ', ':q!', { desc = 'Quickly Quit', noremap = false }) vim.api.nvim_set_keymap('n', 'WW', ':w!', { desc = 'Force write', noremap = false }) vim.api.nvim_set_keymap('n', 'E', '$', { noremap = false }) vim.api.nvim_set_keymap('n', 'B', '^', { noremap = false }) vim.api.nvim_set_keymap('n', 'tT', ':TransparentToggle', { desc = 'Toggle Transparency', noremap = true }) vim.api.nvim_set_keymap('n', 'ss', ':noh', { noremap = true }) -- splits vim.api.nvim_set_keymap('n', ',', ':vertical resize -10', { desc = 'V Resize -', noremap = true }) vim.api.nvim_set_keymap('n', '.', ':vertical resize +10', { desc = 'V Resize +', noremap = true }) -- Quicker close split vim.keymap.set('n', 'qf', ':q', { desc = 'Quicker close split', silent = true, noremap = true }) -- Keymaps for better default experience -- See `:help vim.keymap.set()` vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -- Remap for dealing with word wrap vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) vim.keymap.set('n', 'xe', 'GoIfErr', { desc = 'Go If Error', silent = true, noremap = true }) -- TIP: Disable arrow keys in normal mode vim.keymap.set('n', '', 'echo "Use h to move!!"') vim.keymap.set('n', '', 'echo "Use l to move!!"') vim.keymap.set('n', '', 'echo "Use k to move!!"') vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows -- -- See `:help wincmd` for a list of all window commands vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) 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' }) -- Old habits vim.keymap.set('n', '', 'w', { desc = 'Save file' }) vim.keymap.set('n', 'qq', 'wq!', { desc = '[qq] Quickly Quit' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which -- is not what someone will guess without a bit more experience. -- -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping -- or just use to exit terminal mode vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) vim.api.nvim_create_autocmd('TextYankPost', { callback = function() vim.highlight.on_yank() end, group = highlight_group, pattern = '*', })