local g = vim.g g.mapleader = " " g.maplocalleader = " " require("utils").add_keymaps({ n = { -- Navigation [""] = { cmd = "h", }, [""] = { cmd = "j", }, [""] = { cmd = "k", }, [""] = { cmd = "l", }, -- Disable current highlights [""] = { cmd = " noh ", }, -- Save [""] = { cmd = " w ", }, -- Copies the entire file [""] = { cmd = " %y+ ", }, -- Allow moving the cursor through wrapped lines with and -- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ -- empty mode is same as using :map -- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour [""] = { cmd = "v:count || mode(1)[0:1] == \"no\" ? \"k\" : \"gk\"", opts = { expr = true } }, [""] = { cmd = "v:count || mode(1)[0:1] == \"no\" ? \"j\" : \"gj\"", opts = { expr = true } }, -- Maps to remove [""] = { cmd = "", }, }, i = { }, v = { [""] = { cmd = "v:count || mode(1)[0:1] == \"no\" ? \"k\" : \"gk\"", opts = { expr = true } }, [""] = { cmd = "v:count || mode(1)[0:1] == \"no\" ? \"j\" : \"gj\"", opts = { expr = true } }, [""] = { cmd = ">gv", }, [""] = { cmd = ""] = { cmd = "v:count || mode(1)[0:1] == \"no\" ? \"k\" : \"gk\"", opts = { expr = true } }, [""] = { cmd = "v:count || mode(1)[0:1] == \"no\" ? \"j\" : \"gj\"", opts = { expr = true } }, ["p"] = { cmd = "p:let @+=@0:let @\"=@0", opts = { silent = true }, }, }, })