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 when moving with ctrl-u, ctrl-d keymap("n", "", "zz", opts) keymap("n", "", "zz", opts) 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 buffers keymap("n", "", ":bnext", opts) keymap("n", "", ":bprevious", opts) --Close buffer keymap("n", "", ":bd | bp ", opts) --Format document keymap("n", "F", ":lua vim.lsp.buf.format() ", opts) keymap("n", "ff", "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))", opts) keymap("n", "fw", "lua require'telescope.builtin'.live_grep()", opts) keymap("n", "e", ":Neotree toggle ", opts)