aboutsummaryrefslogblamecommitdiff
path: root/plugin/insert_suspend_hlsearch.vim
blob: 4b601e5cd124cdeec013d75e0f47d2ec64f6cc3f (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                                           
                                                                             

        
                                      
 



                                                                          
                       
                                         
           
"
" insert_suspend_hlsearch.vim: If 'hlsearch' is enabled, switch it off when
" the user starts an insert mode operation, and back on again when they're
" done.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
if exists('loaded_insert_suspend_hlsearch') || &compatible && v:version < 700
  finish
endif
let loaded_insert_suspend_hlsearch = 1

" Clear search highlighting as soon as I enter insert mode, and restore it
" once left
augroup insert_suspend_hlsearch
  autocmd!
  autocmd InsertEnter *
        \ call insert_suspend_hlsearch#()
augroup END