From 292ffffacbb29774ba4703969c55c826a22e1c8b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 27 Aug 2018 16:39:30 +1200 Subject: Use search() in Vim diff section navigation maps This preserves the user's primary search pattern. --- vim/after/ftplugin/diff.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vim/after/ftplugin/diff.vim b/vim/after/ftplugin/diff.vim index eecc8b8c..31403cc3 100644 --- a/vim/after/ftplugin/diff.vim +++ b/vim/after/ftplugin/diff.vim @@ -9,8 +9,10 @@ if exists('g:no_plugin_maps') || exists('g:no_diff_maps') endif " Modify curly braces to navigate by diff block -nnoremap { ?^@@ -nnoremap } /^@@ +nnoremap { + \ :call search('\m^@@', 'bW') +nnoremap { + \ :call search('\m^@@', 'W') let b:undo_ftplugin .= '|nunmap {' \ . '|nunmap }' -- cgit v1.2.3