diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index e6cf542..e9ba858 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -278,12 +278,12 @@ vnoremap utc s/\v(^\|[^0-9])\zs[0-9]{10}\ze([^0-9]\|$)/\=strftime(" " Relax mappings that jump to opening braces on first column: Just make sure " they are on an unindented line. This is useful for files that use a different " coding style guide than the kernel and similar. -" TODO: [count] sections? (see :h [[) -nnoremap [[ m':call search('\v^(\S.*)?\{', "bW") -vnoremap [[ m':exe "normal! gv"call search('\v^(\S.*)?\{', "bW") +" TODO: support [count] +" TODO: sections? (see :h [[ and :h section) +" TODO: exclusive and exclusive-linewise? +noremap [[ call search('\v^(\S.*)?\{', 'bsW') " TODO: map ]] here and remap ][ down below for better modularization -nnoremap ][ m':call search('\v^(\S.*)?\{', "W") -vnoremap ][ m':exe "normal! gv"call search('\v^(\S.*)?\{', "W") +noremap ][ call search('\v^(\S.*)?\{', 'sW') " Match the behaviour of [[ and []. ]] forward to next '}' in the first column " and ][ fw to next '[', instead of the other way around.