vim.g.mapleader = " " vim.keymap.set("n", "pv", vim.cmd.Ex, { desc = "Open netrw (:Ex)" }) -- Move selected text vim.keymap.set("v", "J", ":m '>+1gv=gv", { desc = "Move Selected Text Down" }) vim.keymap.set("v", "K", ":m '<-2gv=gv", { desc = "Move Selected Text Up" }) -- make J better by keeping cursor in place vim.keymap.set("n", "J", "mzJ`z", { desc = "Join line below" }) -- Center half page jumps vim.keymap.set("n", "", "zz", { desc = "Half page jump down" }) vim.keymap.set("n", "", "zz", { desc = "Half page jump up" }) -- Center search -- vim.keymap.set("n", "n", "nzzzv") -- vim.keymap.set("n", "N", "Nzzzv") vim.keymap.set("x", "p", "\"_dP", { desc = "Paste from system clipboard" }) -- system clipboard copying vim.keymap.set("n", "y", "\"+y", { desc = "Copy to system clipboard" }) vim.keymap.set("v", "y", "\"+y", { desc = "Copy to system clipboard" }) vim.keymap.set("n", "Y", "\"+Y", { desc = "Copy to system clipboard" }) -- null register deleting vim.keymap.set("n", "d", "\"_d", { desc = "Delete to null register" }) vim.keymap.set("v", "d", "\"_d", { desc = "Delete to null register" }) -- #todo investigate this vim.keymap.set("n", "Q", "") -- replace current word vim.keymap.set("n", "r", [[:%s/\<\>//gI]], { desc = "Regex replace current word" }) -- make current file executable vim.keymap.set("n", "x", "!chmod +x %", { silent = true, desc = "Make current file executable" }) vim.keymap.set("n", "", "h") vim.keymap.set("n", "", "j") vim.keymap.set("n", "", "k") vim.keymap.set("n", "", "l") vim.keymap.set("i", "", "h") vim.keymap.set("i", "", "j") vim.keymap.set("i", "", "k") vim.keymap.set("i", "", "l") vim.keymap.set("t", "", "h") vim.keymap.set("t", "", "j") vim.keymap.set("t", "", "k") vim.keymap.set("t", "", "l") -- Woe is ye who does not use tmux -- vim.keymap.set("n", "", function() -- vim.cmd.vsplit() -- vim.cmd.terminal() -- end)