Sabrina
Sabrina

Reputation: 1466

Change the hold time of the cursor?

When using the event trigger CursorHoldI I found that it takes about 3 seconds to execute the command.

Is there a way to decrease this time ?

Upvotes: 7

Views: 5911

Answers (1)

Martin Tournoij
Martin Tournoij

Reputation: 27822

From :help CursorHoldI:

Just like CursorHold, but in Insert mode. [..]

And then from :help CursorHold:

CursorHold                      When the user doesn't press a key for the time
                                specified with 'updatetime'.
[..]

The default for updatetime is 4000 (4 seconds); you can change this to something like 1 second:

set updatetime=1000

Note that a very low value may slow Vim down, as some CursorHold commands may be comparatively expensive. It's also used for writing the swap file

Upvotes: 16

Related Questions