runtime(nohlsearch): include the the simple nohlsearch package

fixes: #15039
closes: #15042

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Maxim Kim
2024-06-18 19:32:39 +02:00
committed by Christian Brabandt
parent f189138b39
commit 26de90c631
6 changed files with 41 additions and 4 deletions

View File

@ -0,0 +1,14 @@
" nohlsearch.vim: Auto turn off hlsearch
" Last Change: 2024-06-18
" Maintainer: Maxim Kim <habamax@gmail.com>
"
" turn off hlsearch after:
" - doing nothing for 'updatetime'
" - getting into insert mode
augroup nohlsearch
au!
noremap <Plug>(nohlsearch) <cmd>nohlsearch<cr>
noremap! <expr> <Plug>(nohlsearch) execute('nohlsearch')[-1]
au CursorHold * call feedkeys("\<Plug>(nohlsearch)", 'm')
au InsertEnter * call feedkeys("\<Plug>(nohlsearch)", 'm')
augroup END