From cc7b292bf5504d95d8f21d0efce429807ea44597 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 21 Nov 2019 14:06:49 +0100 Subject: [PATCH] Organize maps.vim First, set mappings that work directly from normal mode, extend or cange the vim operations. After that, set leader mappings. When refactoring into leader / localleader mappings, this should probably be divided into first setting the leader mappings and then setting localleader for different contexts. --- .config/nvim/maps.vim | 47 ++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/.config/nvim/maps.vim b/.config/nvim/maps.vim index 494d190..cea5be0 100644 --- a/.config/nvim/maps.vim +++ b/.config/nvim/maps.vim @@ -12,6 +12,24 @@ " backspace to switch to alternate (last) buffer nnoremap +" since u undoes, would it not make sense that U redoes? +nnoremap U + +" stronger versions of left,right - move all the way to beginning/end of line +nnoremap H ^ +nnoremap L $ + +" move around between matching brackets with tab +nnoremap % +nnoremap % + +" when in insertion mode, C-u uppercases the current word, C-l lowercases it, +inoremap gUiw`]a +inoremap guiw`]a + +" yank filename to f buffer +nnoremap yf :let @f = expand("%") + " repeat the last substitute command with all its flags preserved noremap & \ :&& @@ -65,11 +83,9 @@ nnoremap / :noh nnoremap - :sp nnoremap \ :vsp -" move around between matching brackets with tab -nnoremap % -nnoremap % - " Spell check set to O, 'o' for 'orthography': +" Move to the prev/next spelling error with [S ]S +" Move to the prev/next spelling error or suggestion with [s ]s noremap O :setlocal spell! spelllang=en_us noremap OE :setlocal spell! spelllang=en_us noremap OG :setlocal spell! spelllang=de_de @@ -86,21 +102,6 @@ nnoremap V :vsp $MYVIMRC " source vimrc with keystroke combination nnoremap VV :source $MYVIMRC -" since u undoes, would it not make sense that U redoes? -nnoremap U - -" when in insertion mode, C-u uppercases the current word, C-l lowercases it, -inoremap gUiw`]a -inoremap guiw`]a - -" get rid of the help message popping up when I miss esc and hit F1 -nnoremap -inoremap -vnoremap - -" yank filename to f buffer -nnoremap yf :let @f = expand("%") - " remove all trailing whitespaces " on pressing space+W nnoremap W :%s/\s\+$//:let @/='' @@ -190,11 +191,3 @@ nnoremap Q vapJgqap " Enter distraction free prose mode with F11 noremap :Goyo - -" surround stuff with quotes, from normal or visual mode -nnoremap " viwa"bi"lel -vnoremap " ``>la"l - -" stronger versions of left,right - move all the way -nnoremap H ^ -nnoremap L $