From 50a139f0f014c62ee3138b3bffa906be0f942c81 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 9 Dec 2021 00:39:13 +0100 Subject: [PATCH] Add some more mappings --- home/.config/nvim/lua/core/mappings.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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')