Well, that sample 'myFunc' was just that- a sample. Imagine now, that it
doesn't depend on cursor location but on a daemon running on your
system.

Chuck

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

On 4/3/07, Chuck Mason <[EMAIL PROTECTED]> wrote:
>
> Yes and no- I think this would work in certain situations, but of
course
> what happens when I don't move the cursor?

If you didn't move the cursor -- then why would you
add the same position to the quicfix list again and again ? What's the
point ?
How is adding same position again and again (seems meaningless to me)
better than reacting to cursor motion ?

Yakov

>
> 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