From 99df4a278ca17446d7f480fd73186edb3c23936a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 21 Nov 2019 13:53:51 +0100 Subject: [PATCH] Begin cleaning up maps.vim Added some useful unimpaired mappings and moved localleader to , to prepare for separation of local and global leader mappings. --- .config/nvim/maps.vim | 47 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/.config/nvim/maps.vim b/.config/nvim/maps.vim index 21969bf..e78aa29 100644 --- a/.config/nvim/maps.vim +++ b/.config/nvim/maps.vim @@ -12,14 +12,49 @@ " backspace to switch to alternate (last) buffer nnoremap +" repeat the last substitute command with all its flags preserved +noremap & + \ :&& +ounmap & +sunmap & + +" bracket pairings to go to the next/previous of: +" (works with count prefixes) +" +" Argument list +nnoremap [a + \ :previous +nnoremap ]a + \ :next +" Buffers +nnoremap [b + \ :bprevious +nnoremap ]b + \ :bnext +" Quickfix list +nnoremap [c + \ :cprevious +nnoremap ]c + \ :cnext +" Location list +nnoremap [l + \ :lprevious +nnoremap ]l + \ :lnext + " set our leader key to space since with hjkl, space is largely useless let mapleader = "\" -" maps the leader for buffer local mappings (e.g. vim-waikiki for files under -" the root dir to the same key -- might lead to incompatibilities, will have -" to test) -let maplocalleader = "\" -" set jk to escape, in case capslock is not mapped to escape on the system -inoremap jk +" maps the leader for buffer local mappings +" since we are (atm) using sneak to go fwd/bwd in fFtT searches, comma does +" not do too many useful things and can be taken up as localleader +let maplocalleader = "," + +" If we mapped localleader to comma, we can still get to its original function +" by douple-tapping it. +if maplocalleader ==# ',' + noremap ,, , + sunmap ,, +endif " remove search highlights by pressing space+/ - the key for searching the " first place