aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-05 00:24:01 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-05 00:24:01 +1300
commitddc18dc0c61b4e50775b7937e10c6059df47b1d8 (patch)
tree94e10948f08368d41433e655ba7915b4fc6e54dc
parentc213eec1cb25c07033b9164ad2054a7458e0def0 (diff)
parent871318a0e83f07e6d44be3bc36a472ff226d215f (diff)
downloaddotfiles-ddc18dc0c61b4e50775b7937e10c6059df47b1d8.tar.gz
Merge branch 'feature/vim61-backport' into develop
* feature/vim61-backport: Limit search highlighting hooks to Vim >= 7.1 Add explanatory note for choosing imperfect remap
-rw-r--r--vim/config/search.vim2
-rw-r--r--vim/config/substitution.vim5
2 files changed, 5 insertions, 2 deletions
diff --git a/vim/config/search.vim b/vim/config/search.vim
index a3aba989..ff243116 100644
--- a/vim/config/search.vim
+++ b/vim/config/search.vim
@@ -22,7 +22,7 @@ if has('extra_search')
" Clear search highlighting as soon as I enter insert mode, and restore it
" once I leave it
- if has('autocmd')
+ if has('autocmd') && v:version >= 701
augroup dotfiles_highlight
autocmd!
autocmd InsertEnter
diff --git a/vim/config/substitution.vim b/vim/config/substitution.vim
index f2d7b665..415665ef 100644
--- a/vim/config/substitution.vim
+++ b/vim/config/substitution.vim
@@ -3,6 +3,9 @@
nnoremap <silent>
\ &
\ :<C-U>&&<CR>
-xnoremap <silent>
+
+" Same again for visual mode; we use vnoremap rather than xnoremap to stay
+" compatible with old Vims without doing eval() dances
+vnoremap <silent>
\ &
\ :<C-U>&&<CR>