How do I make Vim respond faster to idle events?
Answer
:set updatetime=250
Explanation
The updatetime option controls how long Vim waits after you stop typing before triggering certain events (like swap file writes and CursorHold autocommands). A lower value makes plugins more responsive.
How it works
- Default is 4000ms (4 seconds)
:set updatetime=250reduces it to 250ms- Affects swap file writing and
CursorHoldevents - Many plugins use
CursorHoldfor updates
Example
set updatetime=250
Now git-gutter signs, diagnostics, and hover info appear faster.
Tips
- vim-gitgutter, ALE, and coc.nvim all benefit from lower updatetime
- Very low values (below 100ms) may cause performance issues
- 250-300ms is a good balance
- Also controls how quickly the swap file is written after you stop typing
- This is one of the most impactful performance settings