On 20/03/10 08:30, epanda wrote:
Hi,
I am using this command in order to retrieve data stored into c:/
infos.txt at regular interval back to GVim without disturbing main
GVim instance.
exec '!start /MIN cmd /c "vim --servername ' . v:servername . ' --
remote-expr "AnalysisCppInfos('."'c:/infos.txt'". ')"'
The problem is that the call of AnalysisCppInfos( happens only one
time.
I would like a call done each time an event occurs.
Event may be :
. each second
. each time the file is written
. etC..
I wonder why it is called only one time.
Thank you
To repetitively call something (in a Vim compiled with the +autocmd
feature), you may want to harness the CursorHold and/or CursorHoldI
event, which, in Normal mode or Insert mode respectively, will fire once
when 'updatetime' milliseconds (by default 4000) have passed since the
last time you pressed a key. Or (IIUC) you may call the feedkeys()
function from that autocommand in order to trigger it again.
Note that changing this option has a side-effect (which from a different
point of view is the main effect): the swapfile is written (if not yet
done since the last time the file was changed) at the same time the
autocommand fires.
Similarly, "each time the file is written" is the BufWrite event.
(BufWrite is an alias of BufWritePre, "just before writing the file".
There is also a BufWritePost event.)
Best regards,
Tony.
--
Character Density, n.:
The number of very weird people in the office.
--
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.