From a3298a0ce98795a6f005490bcc45130f8254d4a2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 30 May 2018 23:03:29 +1200 Subject: Spin off insert_suspend_hlsearch Vim plugin --- .gitmodules | 3 +++ Makefile | 7 ----- vim/bundle/insert_suspend_hlsearch | 1 + vim/doc/insert_suspend_hlsearch.txt | 29 --------------------- vim/plugin/insert_suspend_hlsearch.vim | 47 ---------------------------------- 5 files changed, 4 insertions(+), 83 deletions(-) create mode 160000 vim/bundle/insert_suspend_hlsearch delete mode 100644 vim/doc/insert_suspend_hlsearch.txt delete mode 100644 vim/plugin/insert_suspend_hlsearch.vim diff --git a/.gitmodules b/.gitmodules index 7371c759..045bb6f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,9 @@ [submodule "vim/bundle/commentary"] path = vim/bundle/commentary url = https://sanctum.geek.nz/clone/vim-commentary.git +[submodule "vim/bundle/insert_suspend_hlsearch"] + path = vim/bundle/insert_suspend_hlsearch + url = https://sanctum.geek.nz/code/vim-insert-suspend-hlsearch.git [submodule "vim/bundle/juvenile"] path = vim/bundle/juvenile url = https://sanctum.geek.nz/code/vim-juvenile.git diff --git a/Makefile b/Makefile index c194dc9e..def064d6 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,6 @@ dist-vim-plugin-command-typos \ dist-vim-plugin-copy-linebreak \ dist-vim-plugin-fixed-join \ - dist-vim-plugin-insert-suspend-hlsearch \ dist-vim-plugin-mail-mutt \ dist-vim-plugin-strip-trailing-whitespace \ dist-vim-plugin-toggle-option-flag @@ -680,7 +679,6 @@ dist-vim-plugin: dist-vim-plugin-auto-backupdir \ dist-vim-plugin-copy-linebreak \ dist-vim-plugin-detect-background \ dist-vim-plugin-fixed-join \ - dist-vim-plugin-insert-suspend-hlsearch \ dist-vim-plugin-mail-mutt \ dist-vim-plugin-strip-trailing-whitespace \ dist-vim-plugin-toggle-option-flag @@ -725,11 +723,6 @@ dist-vim-plugin-fixed-join: \ vim/doc/fixed_join.txt \ VERSION sh dist/vim-plugin.sh fixed_join -dist-vim-plugin-insert-suspend-hlsearch: \ - vim/plugin/insert_suspend_hlsearch.vim \ - vim/doc/insert_suspend_hlsearch.txt \ - VERSION - sh dist/vim-plugin.sh insert_suspend_hlsearch dist-vim-plugin-mail-mutt: \ vim/plugin/mail_mutt.vim \ vim/doc/mail_mutt.txt \ diff --git a/vim/bundle/insert_suspend_hlsearch b/vim/bundle/insert_suspend_hlsearch new file mode 160000 index 00000000..a1f580c7 --- /dev/null +++ b/vim/bundle/insert_suspend_hlsearch @@ -0,0 +1 @@ +Subproject commit a1f580c76e5af568235cc03582f4310298be7328 diff --git a/vim/doc/insert_suspend_hlsearch.txt b/vim/doc/insert_suspend_hlsearch.txt deleted file mode 100644 index a6465935..00000000 --- a/vim/doc/insert_suspend_hlsearch.txt +++ /dev/null @@ -1,29 +0,0 @@ -*insert_suspend_hlsearch.txt* For Vim version 7.0 Last change: 2018 May 30 - -DESCRIPTION *insert_suspend_hlsearch* - -This plugin quietly disables 'hlsearch' search highlighting if enabled when an -insert operation is started, and puts it back once done, to avoid the -distracting effect the highlighting can cause while writing. - -REQUIREMENTS *insert_suspend_hlsearch-requirements* - -This plugin is only available if 'compatible' is not set. It also requires the -|+autocmd| and |+extra_search| features. - -AUTHOR *insert_suspend_hlsearch-author* - -Written and maintained by Tom Ryder . - -LICENSE *insert_suspend_hlsearch-license* - -Licensed for distribution under the same terms as Vim itself (see |license|). - -DISTRIBUTION *insert_suspend_hlsearch-distribution* - -This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun -off into a separate distribution as it solidifies and this documentation -improves. See for more -information. - - vim:tw=78:ts=8:ft=help:norl: 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 -" 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 HlsearchSuspend() - autocmd InsertLeave - \ * - \ call HlsearchRestore() -augroup END -- cgit v1.2.3