Vim Tips Wiki
(Move categories to tip template)
(change "anon" author to blank; trim "created" date; minor manual clean)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
|id=1540
 
|id=1540
 
|previous=1539
 
|previous=1539
|next=1541
+
|next=1542
 
|created=December 9, 2007
 
|created=December 9, 2007
 
|complexity=basic
 
|complexity=basic
|author=Anon
+
|author=
 
|version=7.0
 
|version=7.0
  +
|subpage=/200712
 
|category1=Usage
 
|category1=Usage
 
|category2=
 
|category2=
Line 19: Line 20:
   
 
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:
 
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:
 
 
<pre>
 
<pre>
 
" set 'updatetime' to 15 seconds when in insert mode
 
" set 'updatetime' to 15 seconds when in insert mode
Line 34: Line 34:
   
 
==Comments==
 
==Comments==
  +
This is the greatest vim tip of all time. Setting the timeout to a couple of seconds forces you to use vim very efficiently.
 
----
 

Latest revision as of 03:03, 4 December 2009

Tip 1540 Printable Monobook Previous Next

created December 9, 2007 · complexity basic · 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

References[]

Comments[]

This is the greatest vim tip of all time. Setting the timeout to a couple of seconds forces you to use vim very efficiently.