To keep things minimal, but still works perfectly for me, I have this, inspired from above : plain highlight until CursorMoved
:
function! HLNext()
let l:higroup = matchend(getline('.'), '\c'.@/, col('.')-1) == col('.')
\ ? 'SpellRare' : 'IncSearch'
let b:cur_match = matchadd(l:higroup, '\c\%#'.@/, 101)
redraw
augroup HLNext
autocmd CursorMoved <buffer>
\ execute 'silent! call matchdelete('.b:cur_match.')'
\ | redraw
\ | autocmd! HLNext
augroup END
endfunction
nnoremap <silent> * *:call HLNext()<CR>
nnoremap <silent> # #:call HLNext()<CR>
nnoremap <silent> n n:call HLNext()<cr>
nnoremap <silent> N N:call HLNext()<cr>
Now, n
even without hlsearch
shows me the where I landed until I move the cursor. The SpellRare
is used to make it more ovbious when only a single character matches, otherwise it's the smooth IncSearch