Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let s:lasttime = reltime()
- let g:tick_seconds = 2
- function! Tick()
- let l:now = reltime(s:lasttime)
- if l:now[0] > g:tick_seconds
- let s:lasttime = reltime()
- call TickCallback(l:now[0])
- endif
- endfunction
- function! TickCallback(time)
- echomsg "writing file since " . a:time . " seconds."
- endfunction
- au CursorHold * call Tick()
- au CursorHoldI * call Tick()
- au CursorMoved * call Tick()
- au CursorMovedI * call Tick()
Advertisement
Add Comment
Please, Sign In to add comment