From 0d806355ab8320990ecee032bfb3361e5ba63f39 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Fri, 7 May 2021 20:13:51 +0530 Subject: [PATCH] nvim: keymappings: Add helpful mappings for visual block shift & buffer copy --- nvim/.config/nvim/lua/keymappings.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nvim/.config/nvim/lua/keymappings.lua b/nvim/.config/nvim/lua/keymappings.lua index c6a1aaf..abef46f 100644 --- a/nvim/.config/nvim/lua/keymappings.lua +++ b/nvim/.config/nvim/lua/keymappings.lua @@ -115,3 +115,11 @@ remap('c', '', 'getcmdtype() =~ \'[?/]\' ? \'\' : feedkeys(\'\' remap('c', '', 'getcmdtype() =~ \'[?/]\' ? \'\' : feedkeys(\'\', \'int\')[1]', { noremap = true, expr = true }) remap('n', '', ':call SyntaxAttr#SyntaxAttr()', { noremap = true }) + +-- After shifting a visual block, select it again +remap('v', '<', '', '>gv', { noremap = true }) + +-- Copy whole buffer +remap('', '', ':norm gg0VG$cp', { noremap = false }) +remap('i', '', ':norm jkgg0VG$cp', { noremap = false })