local key = vim.keymap.set vim.g.mapleader = "," -- toggle spellcheck key("n", "<leader>l", [[:setlocal spell! spelllang=en_us<CR>]]) -- toggle cursorcolumn key("n", "<leader>c", [[:set cursorcolumn!<CR>]]) -- scroll doc with ctrl+[jk] key({ "n", "v" }, "<C-j>", "<C-e>") key({ "n", "v" }, "<C-k>", "<C-y>") -- go to begining or end of line with ctrl+[hl] key({ "n", "v" }, "<C-h>", "zh") key({ "n", "v" }, "<C-l>", "zl") -- split navigation with ctrl+shift+[hjkl] key("n", "<C-S-h>", "<C-w>h") key("n", "<C-S-j>", "<C-w>j") key("n", "<C-S-k>", "<C-w>k") key("n", "<C-S-l>", "<C-w>l") -- browser like tab shortcuts key("n", "<C-Tab>", "gt") key("n", "<C-S-Tab>", "gT") --key("n", "<C-t>", [[:tabe<CR>]]) --key("n", "<C-w>", [[:tabclose<CR>]]) -- <C-w> is already used lol -- additional tab shortcuts key("n", "<C-t>", "gt") key("n", "<C-T>", "gT") -- copy text to x11 buffer key("", "<C-c>", [["+y]]) key("", "<C-x>", [["+x]]) key("", "<C-S-c>", [["+y]]) key("", "<C-S-x>", [["+x]]) -- unmap ex mode key("", "Q", "<NOP>") -- repeat commands with visual blocks using period key("v", ".", [[:normal .<CR>]]) -- save files with root permissions with command `w!!` key("c", "w!!", [[execute 'silent! write !doas tee % >/dev/null' <bar> edit!]]) -- command mode delete entire line with ctrl+d key("c", "<C-d>", [[<C-E><C-U>]])