Wednesday, March 24, 2010

Re: Problem of frequency call of func through --remote-expr

On Tue, March 23, 2010 3:59 pm, Ben Fritz wrote:
>
>
> On Mar 22, 3:25 pm, epanda <callingel...@hotmail.fr> wrote:
>> Which event can I use to call myFunc each constant time?
>
> There isn't one. The closest you can get is to use both CursorHold and
> CursorMoved. See the :help entry for each. I believe I may have seen a
> way to trick Vim into generating cursor movement with CursorHold, so
> that CursorHold would fire repeatedly, but normally it just fires once
> after the timeout period.

Yes, Simply call feedkeys in your autocommand and put in some key, that
won't hurt. Something like this may be:

fu! s:Run()
let k_refresh="\x0c" " this is ctrl-l
" Do whatever you want to be done here
echomsg strftime("%H:%M:%S ") . "Autocommand triggered"
call feedkeys(k_refresh, 't')
endfu

augroup RunContinuously
au!
au CursorHold * :call s:Run()
augroup end


I am not sure, how invasive this will be for the user, though.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: