aboutsummaryrefslogtreecommitdiff
path: root/runtime/pack/dist/opt/nohlsearch/plugin/nohlsearch.vim
blob: a2d766e41a6526624596611eef65825c05eb166b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" 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