idle timeout to automatically leave insert mode?

2 views
Skip to first unread message

Reckoner

unread,
Apr 21, 2008, 8:09:29 AM4/21/08
to vim_use
Due to a repetitive stress injury, I have heavily customized the keys
in VIM. I don't know this is possible, but it would help there were an
automatic exit out of insert mode after a fixed idle duration. This
would save me having to hit the <ESC> key so frequently to exit insert
mode. In other words, once in insert mode, after not hitting any keys
for 2 seconds or so, VIM would automatically take me out of insert
mode w/o me having to hit the <ESC> key.

I hope that made sense.

Thanks in advance



Tony Mechelynck

unread,
Apr 21, 2008, 8:18:45 AM4/21/08
to vim...@googlegroups.com

:au CursorHoldI * stopinsert

will take you out of Insert mode when you don't type anything for
'updatetime' milliseconds (default 4000). To make it 2 seconds, add

:set ut=2000


Best regards,
Tony.
--
Cancel me not -- for what then shall remain?
Abscissas, some mantissas, modules, modes,
A root or two, a torus and a node:
The inverse of my verse, a null domain.
-- Stanislaw Lem, "Cyberiad"

Reckoner

unread,
Apr 21, 2008, 8:35:38 AM4/21/08
to vim_use
Thank you!

This is life-changing!

On Apr 21, 5:18 am, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:

Benjamin Fritz

unread,
Apr 21, 2008, 10:32:39 AM4/21/08
to vim...@googlegroups.com
On 4/21/08, Reckoner <reck...@gmail.com> wrote:
>
> Thank you!
>
> This is life-changing!
>
> On Apr 21, 5:18 am, Tony Mechelynck <antoine.mechely...@gmail.com>
> wrote:
>
> > On 21/04/08 14:09, Reckoner wrote:
> >
> > > Due to a repetitive stress injury, I have heavily customized the keys> in VIM. I don't know this is possible, but it would help there were an> automatic exit out of insert mode after a fixed idle duration. This> would save me having to hit the<ESC> key so frequently to exit insert> mode. In other words, once in insert mode, after not hitting any keys> for 2 seconds or so, VIM would automatically take me out of insert> mode w/o me having to hit the<ESC> key.
> >
> > > I hope that made sense.
> >
> > > Thanks in advance
> >
> > :au CursorHoldI * stopinsert
> >
> > will take you out of Insert mode when you don't type anything for'updatetime' milliseconds (default 4000). To make it 2 seconds, add
> >
> > :set ut=2000
> >

Tip tip tip!

http://vim.wikia.com/wiki/To_switch_back_to_normal_mode_automatically_after_inaction

Reckoner

unread,
Apr 21, 2008, 2:04:43 PM4/21/08
to vim_use
thanks. BTW, I looked before I posted the question but couldn't find
the tip you reference. It won't be the last time I couldn't find
stuff, though.

thanks again!

On Apr 21, 7:32 am, "Benjamin Fritz" <fritzophre...@gmail.com> wrote:
> http://vim.wikia.com/wiki/To_switch_back_to_normal_mode_automatically...

sc

unread,
Apr 21, 2008, 2:24:26 PM4/21/08
to vim...@googlegroups.com
On Monday 21 April 2008 13:04, Reckoner wrote:
> thanks. BTW, I looked before I posted the question but
> couldn't find the tip you reference. It won't be the last
> time I couldn't find stuff, though.

my mail client (kmail) allows me to click on internet urls
with the mouse and it opens a new instance of firefox on
that url -- it worked for me with no problems, automatically
removing his elipsis (the three trailing periods)

sc


> > http://vim.wikia.com/wiki/To_switch_back_to_normal_mode_a
> >utomatically...


Reply all
Reply to author
Forward
0 new messages