local opts = { noremap = true, silent = true } -- Terminal options for. local term_opts = { silent = true } -- Shorten function name. local keymap = vim.api.nvim_set_keymap --Re-map space as leader key. --I already did this on vim & neovim(init.vim). keymap("", "", "", opts) vim.g.mapleader = " " vim.g.maplocalleader = " " -- Modes -- normal_mode = "n", -- insert_mode = "i", -- visual_mode = "v", -- visual_block_mode = "x", -- term_mode = "t", -- command_mode = "c", -- Normal -- -- Better window navigation -- Exactly what I would have done... keymap("n", "", "h", opts) keymap("n", "", "j", opts) keymap("n", "", "k", opts) keymap("n", "", "l", opts) -- Toggle NetRW Plugin for now... keymap("n", "e", ":Lex 30", opts) -- Resize with with Ctrl-Up/Down/Left/Right. -- Tweaked slightly like on the Video-series. keymap("n", "", ":resize +2", opts) keymap("n", "", ":resize -2", opts) keymap("n", "", ":vertical resize +2", opts) keymap("n", "", ":vertical resize -2", opts) -- Navigate buffers. -- I like changing buffers this way, -- b/c I was running into problems w/ Ctrl-f/b. keymap("n", "", ":bnext", opts) keymap("n", "", ":bprevious", opts) -- Insert -- -- Press jk fast to enter Normal-mode, from Insert-mode. keymap("i", "jk", "", opts) -- Visual -- -- Stay in indent mode. -- I like this idea. keymap("v", "<", "", ">gv", opts) -- Move text highlights up & down. keymap("v", "", ":m .+1==", opts) keymap("v", "", ":m .-2==", opts) keymap("v", "p", '"_dP', opts) -- Subltle change, but if you paste over a visual selection; -- Now it won't put what you pasted over into the 2-be-pasted-next buffer. -- Visual Block -- -- Move full lines Up/Down. 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) -- Terminal -- -- Better terminal navigation... ??? -- This is the ONLY block I am not sure if I want to include in my config, -- b/c I don't understand what it does; so I'll disable it for now... -- keymap("t", "", "h", term_opts) -- keymap("t", "", "j", term_opts) -- keymap("t", "", "k", term_opts) -- keymap("t", "", "l", term_opts)