neovim/runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim
Christian Clason 38a1d41ac0 vim-patch:aeca717: runtime(nohlsearch): simplify mapping
Use <cmd> instead of <expr> with execute(...)[-1]

closes: vim/vim#15047

aeca7176f3

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-06-19 22:50:54 +02:00

15 lines
471 B
VimL

" nohlsearch.vim: Auto turn off hlsearch
" Last Change: 2024-06-19
" 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! <Plug>(nohlsearch) <cmd>nohlsearch<cr>
au CursorHold * call feedkeys("\<Plug>(nohlsearch)", 'm')
au InsertEnter * call feedkeys("\<Plug>(nohlsearch)", 'm')
augroup END