local set = vim.keymap.set local function remapkey(mode, key, action) vim.keymap.set(mode, key, action, { noremap = true, silent = true }) end -- dagnostic popup set("n", "e", ":lua vim.diagnostic.open_float()") -- ESC insert to normal ctrl jk -- set("i", "", "") -- set("v", "t", "!pandoc -f csv -t commonmark_x") set("v", "", "!pandoc -f csv -t commonmark_x") -- common save shortcuts set("i", "", ":wa") set("n", "", ":w") -- don't move the cursor set("n", "J", "mzJ`z") -- keep cursor in the middle set("n", "", "zz") set("n", "", "zz") set("n", "n", "nzzzv") set("n", "N", "Nzzzv") -- preserve clipboard when pasting set("x", "p", '"_dp') -- sane movement with wrap o n remapkey({ "n", "v" }, "j", "gj") remapkey({ "n", "v" }, "k", "gk") remapkey({ "n", "v" }, "", "gj") remapkey({ "n", "v" }, "", "gk") remapkey("i", "", "gj") remapkey("i", "", "gk") -- terminal shortcuts remapkey("i", "", ":termA") remapkey("n", "A") -- tab key in visual mode set("v", "", ">gv") set("v", "", "=escape(@\",'/\\')") -- no ex mode etc remapkey("n", "Q", "") remapkey("n", "", "") -- center current line remapkey("n", "cc", ":center") -- write to files with root privileges set("c", "w!!", ":w !sudo tee % >/dev/null") -- blamer -- set("", "", ":BlamerToggle") -- delete to void register set({ "n", "v" }, "d", '"_d') -- quickfix list set("n", "", "cnextzz") set("n", "C-c>", "cprevzz") set("n", "x", "lnextzz") set("n", "c", "lprevzz") -- typo fix set("i", "", "") set("n", "q:", ":q") vim.cmd([[ ia tongiht tonight ia htese these ia od do ia nothign nothing ia htey they ia htem them ia iwth with ia maxium maximum ia funtcion function ia fucntion function ia funciton function ia dfe def ia edn end ia teh the ia hte the ia htis this ia tihs this ia taht that ia retunr return ia reutrn return ia eariler earlier ia ulness unless ia ahve have ia chatper chapter ia colmun column ia amster master ia orgiin origin ia somehting something ia hting thing ia orgniaztion organization ia orgnization organization ]])