I'm trying to write a plugin for vim with vimscript
and I want to show some log for specefic time. like:
echo 'some log'
sleep 2
redraw!
When I use sleep
and redraw
, all of current window freezing for a while but I want sleep just for logs, not all vim window!
How can I do that?
sleep
will always block. With VIM version 8 you can use timer
instead. Here is a stripped down example should not block VIM:
echo 'some log'
let timer = timer_start(2000, 'LogTrigger',{'repeat':-1})
func! LogTrigger(timer)
silent! redraw!
endfunc
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments