You can have something happen on multiples of CursorHold and CursorHoldI by doing something like this (untested):
:let g:flag = 0 :au CursorHoldI * if g:flag == 1 | doSomething | let g:flag = 0 | else | let g:flag += 1 | endif The 'doSomething' bit should only happen every other CursorHoldI firing. You could change the if condition to work off a higher number if you want. I have a (relatively) complicated function called LongEnough that return true/false if it has either been sufficiently long since the last time it was called or if it has been called quite frequently. Useful if you want to execute something either every 5 seconds or every 3 calls, for example. I can share it if it'll help. Salman. > -----Original Message----- > From: Eric Smith [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 08, 2007 5:17 PM > To: [email protected] > Subject: Re: automatically enter normal mode > > 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 >
