From cbacf728e61f480654aa7ed6a5de041cc7013ade Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 20 Nov 2024 12:54:07 +0100 Subject: [PATCH] vim:keys: Add `e` flag to [[ and ]] mappings Let the search place the cursor on the curly brace instead of the start of the line. --- .config/vim/vimrc.d/40-keys.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index e9ba858..74d2497 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -281,9 +281,9 @@ vnoremap utc s/\v(^\|[^0-9])\zs[0-9]{10}\ze([^0-9]\|$)/\=strftime(" " TODO: support [count] " TODO: sections? (see :h [[ and :h section) " TODO: exclusive and exclusive-linewise? -noremap [[ call search('\v^(\S.*)?\{', 'bsW') +noremap [[ call search('\v^(\S.*)?\{', 'besW') " TODO: map ]] here and remap ][ down below for better modularization -noremap ][ call search('\v^(\S.*)?\{', 'sW') +noremap ][ call search('\v^(\S.*)?\{', 'esW') " Match the behaviour of [[ and []. ]] forward to next '}' in the first column " and ][ fw to next '[', instead of the other way around.