-- open project view with netrw vim.keymap.set("n", "pv", vim.cmd.Ex) -- file splitting vim.keymap.set("n", "vs", vim.cmd.vsplit) vim.keymap.set("n", "hs", vim.cmd.split) -- moving selected lines across lines vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") -- not moving cursor when bringing files up vim.keymap.set("n", "J", "mzJ`z") -- keep cursor in screen center when moving up and down vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") -- keep cursor in screen center when traversing in find vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "N", "Nzzzv") vim.keymap.set("x", "p", "\"_dP") ---- system clipboard -- copying vim.keymap.set("n", "y", [["+y]]) vim.keymap.set("v", "y", [["+y]]) vim.keymap.set("n", "Y", [["+Y]]) -- pasting -- @note: for posting in insert mode use: + vim.keymap.set("n", "p", [["+p]]) vim.keymap.set("n", "P", [["+P]]) vim.keymap.set("v", "p", [["+p]]) -- deleting without polluting vim clipboard vim.keymap.set({"n", "x"}, "x", [["_x]]) vim.keymap.set({"n", "x"}, "X", [["_d]]) -- global substitute the word cursor is on in current file vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) ---- remapping quickfix list navigation -- go to next error vim.keymap.set("n", "", function() SafeCListNav(1) end) -- go to prev error vim.keymap.set("n", "", function() SafeCListNav(-1) end) -- open error list when there are errors vim.keymap.set("n", "", vim.cmd.cw) -- building -- vim.keymap.set("n", "", vim.cmd.Neomake{bang=true})