diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index ac52b55..c00f596 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -268,6 +268,15 @@ augroup END nnoremap utc ciw=strftime("%F %T", @") vnoremap utc s/\v(^\|[^0-9])\zs[0-9]{10}\ze([^0-9]\|$)/\=strftime("%F %T",submatch(0))/g +" 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('^\S.*{', "bW") +vnoremap [[ m':exe "normal! gv"call search('^\S.*{', "bW") +nnoremap ]] m':call search('^\S.*{', "W") +vnoremap ]] m':exe "normal! gv"call search('^\S.*{', "W") + " Match the behaviour of [[ and []. ]] forward to next '}' in the first column " and ][ fw to next '[', instead of the other way around. noremap ]] ][