robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

An Guolivim-patch:ce4f9d2: runtime(nohlsearch): fix CursorHold loop (#36221)671841673e

master
514 B24 linesraw
1" nohlsearch.vim: Auto turn off hlsearch
2" Last Change: 2025-03-08
3" Maintainer: Maxim Kim <habamax@gmail.com>
4"
5" turn off hlsearch after:
6" - doing nothing for 'updatetime'
7" - getting into insert mode
8
9if exists('g:loaded_nohlsearch')
10    finish
11endif
12let g:loaded_nohlsearch = 1
13
14func! s:Nohlsearch()
15    if v:hlsearch
16        call feedkeys("\<cmd>nohlsearch\<cr>", 'm')
17    endif
18endfunc
19
20augroup nohlsearch
21    au!
22    au CursorHold * call s:Nohlsearch()
23    au InsertEnter * call s:Nohlsearch()
24augroup END