mirror of
https://github.com/vim/vim
synced 2025-04-30 05:17:45 +02:00
fix exception when entering the insert mode with paste closes: #16818 Co-authored-by: Maxim Kim <habamax@gmail.com> Signed-off-by: qaqland <qaq@qaq.land> Signed-off-by: Christian Brabandt <cb@256bit.org>
24 lines
514 B
VimL
24 lines
514 B
VimL
" nohlsearch.vim: Auto turn off hlsearch
|
|
" Last Change: 2025-03-08
|
|
" 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
|
|
|
|
func! s:Nohlsearch()
|
|
if v:hlsearch
|
|
call feedkeys("\<cmd>nohlsearch\<cr>", 'm')
|
|
endif
|
|
endfunc
|
|
|
|
augroup nohlsearch
|
|
au!
|
|
au CursorHold * call s:Nohlsearch()
|
|
au InsertEnter * call s:Nohlsearch()
|
|
augroup END
|