Skip to content

Add timeout option to key mappings#9551

Merged
kovidgoyal merged 1 commit into
kovidgoyal:masterfrom
theAnuragMishra:master
Feb 25, 2026
Merged

Add timeout option to key mappings#9551
kovidgoyal merged 1 commit into
kovidgoyal:masterfrom
theAnuragMishra:master

Conversation

@theAnuragMishra

Copy link
Copy Markdown
Contributor

This PR introduces timeouts for keyboard modes and multi-key mappings.

A timeout (in seconds) after which an active mode or incomplete key sequence is automatically cancelled can be configured:

  • Globally via the map_timeout option (applies to all multi-key and modal mappings)
  • Per-mode using the --timeout flag (overrides the global setting)

A timeout value of 0 (which is also the default), disables the timer which means the sequence or the mode will be active until manually cancelled or completed.

For multi-key sequences, the timeout is restarted after each valid key press.

I have tested a dev build with the following combinations of global and per mode timeouts:

  1. no timeout configured at all.
  2. global map_timeout set, but no --timeout set for any mode.
  3. --timeout configured for a mode but no global map_timeout specified.
  4. map_timeout set to 0.0 and a non zero --timeout set.
  5. --timeout set to 0.0 for a mode but a non-zero map_timeout set.
  6. map_timeout and --timeout both configured and non-zero.
    Everything worked as intended.

@kovidgoyal
kovidgoyal merged commit 3108c0b into kovidgoyal:master Feb 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants