diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index d2ec08a..9f61e57 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -274,11 +274,11 @@ vnoremap utc s/\v(^\|[^0-9])\zs[0-9]{10}\ze([^0-9]\|$)/\=strftime(" " 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('^\S.*{', "bW") -vnoremap [[ m':exe "normal! gv"call search('^\S.*{', "bW") +nnoremap [[ m':call search('\v^(\S.*)?\{', "bW") +vnoremap [[ m':exe "normal! gv"call search('\v^(\S.*)?\{', "bW") " map ]] here and remap ][ down below for better modularization -nnoremap ][ m':call search('^\S.*{', "W") -vnoremap ][ m':exe "normal! gv"call search('^\S.*{', "W") +nnoremap ][ m':call search('\v^(\S.*)?\{', "W") +vnoremap ][ m':exe "normal! gv"call search('\v^(\S.*)?\{', "W") " Match the behaviour of [[ and []. ]] forward to next '}' in the first column " and ][ fw to next '[', instead of the other way around.