[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:

  1. Reduce the debounce for vim mode toggle events — mode changes are cheap to detect and users expect instant feedback (matching terminal vim/neovim behavior)
  2. Make the debounce configurable — e.g., a debounceMs field in the statusLine config object
  3. 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 hideVimModeIndicator doesn'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

  1. User enables vim mode and configures a custom statusline that renders vim.mode with color coding (e.g., purple for INSERT, blue for NORMAL)
  2. User sets hideVimModeIndicator: true to avoid showing the mode twice
  3. User presses Escape to switch to NORMAL mode
  4. ~300ms passes before the statusline updates — feels sluggish compared to the instant built-in indicator
  5. 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 (hideVimModeIndicator not working), #53881 (vim mode indicator positioning)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗