History Report a problem
Article Edit this page Discussion

To switch back to normal mode automatically after inaction

From Vim Tips Wiki

Jump to: navigation, search
 

Tip 1540Previous TipNext Tip

Created: December 9, 2007 Complexity: basic Author: Anon Version: 7.0


Looking for a way to exit insert mode automatically when you haven't typed anything for a few seconds?

Try:

" automatically leave insert mode after 'updatetime' milliseconds of inaction
au CursorHoldI * stopinsert

If you find that this event fires too quickly, you can adjust 'updatetime' to suit your needs, but you might want to consider doing so only when you enter insert mode:

" set 'updatetime' to 15 seconds when in insert mode
au InsertEnter * let updaterestore=&updatetime | set updatetime=15000
au InsertLeave * let &updatetime=updaterestore

[edit] References

[edit] Comments

 

Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Doctor Who
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Mystery Science Theater 3000
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"To switch back to normal mode automatically after inaction"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation