diff --git a/home/.config/nvim/lua/core/mappings.lua b/home/.config/nvim/lua/core/mappings.lua index a35c434..4e4afa8 100644 --- a/home/.config/nvim/lua/core/mappings.lua +++ b/home/.config/nvim/lua/core/mappings.lua @@ -59,6 +59,18 @@ m.keymap("v", "", "zf") m.keymap("n", "K", "10k") m.keymap("n", "J", "10j") +-- Moving lines around +m.keymap("v", "", ":m '>+1gv=gv") +m.keymap("v", "", ":m '<-2gv=gv") +m.keymap("i", "", ":m .+1==i") +m.keymap("i", "", ":m .-2==i") +m.keymap("n", "j", ":m .+1==") +m.keymap("n", "k", ":m .-2==") + +-- Quick word replacing (use . for next word) +m.keymap("n", "cn", "*``cgn") +m.keymap("n", "cN", "*``cgN") + -- Enable/Disable auto commenting m.keymap("n", "c", ":setlocal formatoptions-=cro") m.keymap("n", "C", ":setlocal formatoptions+=cro") @@ -67,6 +79,10 @@ m.keymap("n", "C", ":setlocal formatoptions+=cro") m.keymap("v", "<", "", ">gv") +-- Center (and unfold) after going to next/prev search item +m.keymap("n", "n", "nzzzv") +m.keymap("n", "N", "Nzzzv") + -- System clipboard copying m.keymap("v", "", '"+y')