Another useful mapping (which I have on <leader><leader><leader>
, or 3 spaces for me) is to "blink" the current cursor location in an obvious way:
" ~/.vim/autoload/bk.vim
function bk#cursor#blink(time) abort
call bk#cursor#hl_on()
let time_in_ms = float2nr(a:time * 1000)
if has('timers')
let _ = timer_start(time_in_ms, {_ -> bk#cursor#hl_off()})
else
exec 'sleep' time_in_ms 'm'
call bk#cursor#hl_off()
endif
endfunction
function bk#cursor#hl_on() abort
set cursorline cursorcolumn
redraw
endfunction
function bk#cursor#hl_off() abort
set nocursorline nocursorcolumn
redraw
endfunction
Along with
nnoremap <leader><leader><leader> :call bk#cursor#blink(0.2)<enter>
(Adjust timing as needed.)
:h wincolor