Have vim exit insert mode automatically after some time

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Have vim exit insert mode automatically after some time

Post by ^rooker »

Switching between insert and command mode in vim is (at least for me) the most ineffective finger-movement, because the ESCape key is too far away from my home row. :(

Obviously, there are more people out there that feel the same way, so here's a solution:

1) Edit .vimrc (either ~/.vimrc or /etc/vimrc).
2) Add the following lines:

Code: Select all

au! CursorHoldI * stopinsert
set updatetime=500
This causes vim to leave the insert mode after 500msec of inactivity. I love it!
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply