local opts = { noremap = true, silent = true } local term_opts = { silent = true } local keymap = vim.api.nvim_set_keymap keymap("", "", "", opts) vim.g.mapleader = " " vim.g.maplocalleader = " " --window navigation keymap("n", "", "h", opts) keymap("n", "", "j", opts) keymap("n", "", "k", opts) keymap("n", "", "l", opts) -- Resize with arrows keymap("n", "", ":resize +2", opts) keymap("n", "", ":resize -2", opts) keymap("n", "", ":vertical resize -2", opts) keymap("n", "", ":vertical resize +2", opts) --move text up and down keymap("v", "", ":m .+1==", opts) keymap("v", "", ":m .-2==", opts) keymap("v", "p", '"_dP', opts) keymap("v", "<", "", ">gv", opts) -- center view for different commands keymap("n", "n", "nzz", opts) keymap("n", "N", "Nzz", opts) keymap("n", "*", "*zz", opts) keymap("n", "#", "#zz", opts) keymap("n", "g*", "g*zz", opts) keymap("n", "g#", "g#zz", opts) keymap("n", "", "zz", opts) keymap("n", "", "zz", opts) -- Allow moving selected text keymap("x", "J", ":move '>+1gv-gv", opts) keymap("x", "K", ":move '<-2gv-gv", opts) keymap("x", "", ":move '>+1gv-gv", opts) keymap("x", "", ":move '<-2gv-gv", opts) -- Navigate tabs keymap("n", "", ":tabnext", opts) keymap("n", "", ":tabprevious", opts) -- Copy to clipboard keymap("v", "", "\"+y", opts) --Close buffer -- keymap("n", "", ":bd | bp ", opts)