Eric Smith wrote:
On 08/05/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
In an autocommand, you need an ex-command, which <Esc> isn't. I suggest
:au CursorHoldI * stopinsert
Make sure 'updatetime' has a long enough value (the default is 4000,
i.e., 4
seconds, which might be a little short for some people).
Problem now is that I already have:
au CursorHoldI * update
and this wants an updatetime of 4000 while as you say stopinsert will
want a higher number.
Is there a way?
Thanks
Eric
If you can bear to have insert mode stopped after you stopped banging at keys
for "only" four seconds, or if you can bear to have the autosave happen not
four seconds after you stopped banging at keys but after some more delay, then
there is a way. (I would suggest 10 seconds but YMMV.)
If you want a fast auto save _and_ a slow stopinsert, then it isn't obvious
how to do it, since the CusorHoldI event will fire _once_ when you're in
Insert mode and haven't been using the keyboard in Vim for 'updatetime'
milliseconds, and then it won't fire again until you hit a key. (I think
clicking the mouse counts as "hitting a key" in this context but I'm not 100%
sure.)
Best regards,
Tony.
--
If God had not given us sticky tape, it would have been necessary to
invent it.