vim.g.mapleader = " " local opts = { noremap = true, silent = true } local term_opts = { silent = true } local keymap = vim.keymap.set keymap('t', '', '', { noremap = true }) -- window navigation keymap("n", "", "h", opts) keymap("n", "", "j", opts) keymap("n", "", "k", opts) keymap("n", "", "l", opts) -- window resizing keymap("n", "", ":resize -2", opts) keymap("n", "", ":resize +2", opts) keymap("n", "", ":vertical resize -2", opts) keymap("n", "", ":vertical resize +2", opts) -- buffer navigation keymap("n", "", ":bnext", opts) keymap("n", "", ":bprevious", opts) -- move selection up or down keymap("n", "", ":m .+1==", opts) keymap("n", "", ":m .-2==", opts) -- don't exit visual mode keymap("v", "<", "", ">gv^", opts) -- Move text up and down keymap("v", "", ":m '>+1gv=gv", opts) keymap("v", "", ":m '<-2gv=gv", opts) keymap("v", "p", '"_dP', opts) -- Move text up and down keymap("x", "J", ":m '>+1gv=gv", opts) keymap("x", "K", ":m '<-2gv=gv", opts) keymap("x", "", ":m '>+1gv=gv", opts) keymap("x", "", ":m '<-2gv=gv", opts) -- force me to use vim keys keymap('n', '', '', opts) keymap('n', '', '', opts) keymap('n', '', '', opts) keymap('n', '', '', opts) keymap('i', '', '', opts) keymap('i', '', '', opts) keymap('i', '', '', opts) keymap('i', '', '', opts) keymap('i', '', '', opts) keymap('i', '', '', opts) keymap('i', '', '', opts) keymap('i', '', '', opts) keymap('x', '', '', opts) keymap('x', '', '', opts) keymap('x', '', '', opts) keymap('x', '', '', opts) -- split windows keymap('n', 'v', ':vsplit', opts) keymap('n', 'h', ':split', opts) keymap('n', '', ':nohlsearch', opts) keymap('n', 's', ':lua if vim.o.spell then vim.o.spell = false else vim.o.spell = true end', { noremap = true, silent = true }) keymap('n', 'c', ':ColorizerToggle', opts) -- Tabs keymap('n', '', ':tabnew', opts) keymap('n', '', ':tabclose', opts) keymap('n', '', ':tabp', opts) keymap('n', '', ':tabn', opts) -- Trouble.lua keymap('n', 't', ':TroubleToggle', opts) -- lsp diagnostic movement keymap('n', '>d', ':lua vim.diagnostic.goto_next()', opts) keymap('n', '', opts) -- source init keymap('n', 'ri', ':luafile ~/.config/nvim/init.lua', opts) -- ri: reload init