On 4/3/07, Chuck Mason <[EMAIL PROTECTED]> wrote:


I'm interested in writing a plugin that could run in the background as I
do some work in a buffer. For instance I have a function that appends a
line to :copen. I would like to run it in the background continuously.
How could I do this and continue working in the foreground?

func myFunc()
        while 1
                exe "caddexpr expand("%") . ":" . line(".") .  ":" .
getline(".")"
                exe "sleep 5"
        endwhile
endfunc

"" how do I launch myFunc() to run continuously in the background?

Chuhk,
You probably want to give the 'au CursorMoved' autocommand
a try for this task.
Such tasks are normally solved with autocommands in vim.
See:
:help au
:hep CursorMoved

Good luck
Yakov

Reply via email to