Created
January 18, 2022 14:27
-
-
Save jdhao/f60036ccc863a35cc50067fa60ca8778 to your computer and use it in GitHub Desktop.
Blink cursor for Nvim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func! ToggleCursor(timer) | |
if &cursorcolumn | |
set nocursorcolumn | |
else | |
set cursorcolumn | |
endif | |
if &cursorline | |
set nocursorline | |
else | |
set cursorline | |
endif | |
endfunc | |
function! RestoreCursor(timer) abort | |
let &cursorcolumn = g:curcol | |
let &cursorline = g:curline | |
endfunction | |
function! BlinkCursor() abort | |
let g:curcol = &cursorcolumn | |
let g:curline = &cursorline | |
let timer1 = timer_start(100, 'ToggleCursor', | |
\ {'repeat': 6}) | |
let timer2 = timer_start(1000, 'RestoreCursor') | |
endfunction | |
nnoremap <leader>cb :call BlinkCursor()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment