[FEATURE] Reduce or make configurable the 300ms debounce on vim mode statusline updates
Resolved 💬 1 comment Opened May 8, 2026 by khaledsulayman Closed Jun 5, 2026
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When rendering vim.mode in a custom statusline script, there's a noticeable ~300ms delay between pressing Escape (or entering INSERT) and the statusline reflecting the mode change. Per the docs, event-driven statusline updates are debounced at 300ms.
The built-in vim mode indicator (-- INSERT --) updates instantly because it's rendered directly by the TUI. But users who want to render vim mode in their custom statusline (with color coding, custom placement, etc.) get a visibly laggy experience. The script itself executes in ~10ms — the debounce dominates perceived latency.
Proposed Solution
Any of these would work:
- Reduce the debounce for vim mode toggle events — mode changes are cheap to detect and users expect instant feedback (matching terminal vim/neovim behavior)
- Make the debounce configurable — e.g., a
debounceMsfield in thestatusLineconfig object - Skip debounce entirely for vim mode toggles — treat them as high-priority events since they're user-initiated and latency-sensitive
Alternative Solutions
- Keeping the built-in vim mode indicator visible alongside the custom statusline — but this creates visual duplication, and
hideVimModeIndicatordoesn't appear to work yet (#53556) - Polling with a low
refreshInterval— but 1 second (the minimum) is far too slow for mode switching
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- User enables vim mode and configures a custom statusline that renders
vim.modewith color coding (e.g., purple for INSERT, blue for NORMAL) - User sets
hideVimModeIndicator: trueto avoid showing the mode twice - User presses Escape to switch to NORMAL mode
- ~300ms passes before the statusline updates — feels sluggish compared to the instant built-in indicator
- With a lower or configurable debounce, the custom indicator would feel as responsive as the built-in one
Additional Context
- Claude Code v2.1.112, macOS
- Related: #53556 (
hideVimModeIndicatornot working), #53881 (vim mode indicator positioning)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗