From 8b6eae719fee4302796817e040d992629b456954 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 11:19:58 +1200 Subject: Handle visual mode better in Vim mappings --- vim/vimrc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 431a51c9..96023a77 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -175,17 +175,26 @@ if has('windows') endif -" Rebind normal to scroll down a page +" Rebind normal, visual to scroll down a page nnoremap +if v:version >= 700 + xnoremap +endif -" Rebind normal & to preserve substitution flags +" Rebind normal, visual & to preserve substitution flags nnoremap & :&& +if v:version >= 700 + xnoremap & :&& +endif " Stack insert Ctrl-C to undo the escaped insert operation inoremap u -" Stack normal Ctrl-L to clear search highlighting before redraw +" Stack normal, visual Ctrl-L to clear search highlight before redraw nnoremap :nohlsearch +if v:version >= 700 + xnoremap :nohlsearchgv +endif " Cycle through argument list nnoremap [a :previous -- cgit v1.2.3