Yes and no- I think this would work in certain situations, but of course
what happens when I don't move the cursor? 

Actually, why isn't there a Timer autocommand? :)  Feature request? 

-----Original Message-----
From: Yakov Lerner [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 03, 2007 11:05 AM
To: Chuck Mason
Cc: vim@vim.org
Subject: Re: Executing vimfunctions in background

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