neovim/runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim
Christian Clason e1d48d5cf2 vim-patch:5753d99: runtime(nohlsearch): add missing loaded_hlsearch guard
related: vim/vim#15039
closes: vim/vim#15402

5753d99ff6

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-07-31 23:06:28 +02:00

21 lines
551 B
VimL

" nohlsearch.vim: Auto turn off hlsearch
" Last Change: 2024-07-31
" Maintainer: Maxim Kim <habamax@gmail.com>
"
" turn off hlsearch after:
" - doing nothing for 'updatetime'
" - getting into insert mode
if exists('g:loaded_nohlsearch')
finish
endif
let g:loaded_nohlsearch = 1
augroup nohlsearch
au!
noremap <Plug>(nohlsearch) <cmd>nohlsearch<cr>
noremap! <Plug>(nohlsearch) <cmd>nohlsearch<cr>
au CursorHold * call feedkeys("\<Plug>(nohlsearch)", 'm')
au InsertEnter * call feedkeys("\<Plug>(nohlsearch)", 'm')
augroup END