diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-05-30 23:03:29 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-05-30 23:04:42 +1200 |
commit | a3298a0ce98795a6f005490bcc45130f8254d4a2 (patch) | |
tree | a10aca9cb6e17bfca86c5e7389f9fc82c7a52e34 /vim/plugin | |
parent | Merge branch 'feature/vim-hlsearc...' into develop (diff) | |
download | dotfiles-a3298a0ce98795a6f005490bcc45130f8254d4a2.tar.gz dotfiles-a3298a0ce98795a6f005490bcc45130f8254d4a2.zip |
Spin off insert_suspend_hlsearch Vim plugin
Diffstat (limited to 'vim/plugin')
-rw-r--r-- | vim/plugin/insert_suspend_hlsearch.vim | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/vim/plugin/insert_suspend_hlsearch.vim b/vim/plugin/insert_suspend_hlsearch.vim deleted file mode 100644 index b916ac42..00000000 --- a/vim/plugin/insert_suspend_hlsearch.vim +++ /dev/null @@ -1,47 +0,0 @@ -" -" 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('g:loaded_insert_suspend_hlsearch') || &compatible - finish -endif -if !has('autocmd') || !has('extra_search') || v:version < 700 - finish -endif -let g:loaded_insert_suspend_hlsearch = 1 - -" Save the current value of the 'hlsearch' option in a script variable, and -" disable it if enabled. Note that :nohlsearch does not work for this; see -" :help autocmd-searchpat. -function s:HlsearchSuspend() - let s:hlsearch = &hlsearch - if s:hlsearch - set nohlsearch - endif - return -endfunction - -" Restore the value of 'hlsearch' from the last time s:HlsearchSuspend was -" called. -function s:HlsearchRestore() - if s:hlsearch - set hlsearch - endif - return -endfunction - -" Clear search highlighting as soon as I enter insert mode, and restore it -" once left -augroup insert_suspend_hlsearch - autocmd! - autocmd InsertEnter - \ * - \ call <SID>HlsearchSuspend() - autocmd InsertLeave - \ * - \ call <SID>HlsearchRestore() -augroup END |