Delayed function call?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Delayed function call?

jason heddings-2
Is it possible to do a delayed function call in vim?
For example, I would like to monitor the status of a file, but retain
control in vim.  This means polling periodically to check the file and
alerting if the file is ready.

I would envision something like this:

function FileMonitor(file)
  if !filewritable(a:file)
    delay-call("FileMonitor(" . a:file . ")", 60)
  else
    echo "File's done!!"
  endif
endfunction