vim: Swap q/Q in Helix mode to match Helix macro semantics#57622
Merged
Conversation
smitbarmase
approved these changes
May 26, 2026
smitbarmase
left a comment
Member
There was a problem hiding this comment.
Thanks. I tested it. This behavior makes sense.
Helix inverts Vim's macro keys: `Q` starts/stops recording, `q` replays. Currently both keys leak through to Helix mode from the catch-all `VimControl && !menu` section using Vim's mapping, so Helix users attempting to record a macro with `Q` instead play back, and vice versa. Helix's default keymap explicitly chooses this inversion — the swapped Vim mapping is even present as a commented-out alternative in helix-term/src/keymap/default.rs: "Q" => record_macro, "q" => replay_macro, // "q" => record_macro, // "Q" => replay_macro, Override both in the shared `(vim_mode == helix_normal || vim_mode == helix_select)` section. Refs https://docs.helix-editor.com/keymap.html Refs zed-industries#4642
21d7277 to
e3cad3b
Compare
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 2, 2026
…tries#57622) Helix inverts Vim's macro keys: **`Q`** starts/stops recording, **`q`** replays. Currently both leak through to Helix mode from the catch-all `VimControl && !menu` section using Vim's mapping, so Helix users hitting `Q` to record a macro instead get playback, and vice versa. Helix's default keymap explicitly chooses this inversion — the Vim mapping is even present as a commented-out alternative in [helix-term/src/keymap/default.rs](https://github.com/helix-editor/helix/blob/master/helix-term/src/keymap/default.rs): ```rust "Q" => record_macro, "q" => replay_macro, // "q" => record_macro, // "Q" => replay_macro, ``` ### Before | Key | Helix expects | Zed actual (leaked from Vim) | | --- | --- | --- | | `q` | `replay_macro` | `vim::ToggleRecord` | | `Q` | `record_macro` (start/stop) | `vim::ReplayLastRecording` | ### After | Key | Action | | --- | --- | | `q` | `vim::ReplayLastRecording` | | `shift-q` | `vim::ToggleRecord` | Refs https://docs.helix-editor.com/keymap.html Refs zed-industries#4642 Bounty: https://app.opire.dev/issues/01J6HJZCK02FVD4XG900FY36EE ### Release Notes: - vim: Swapped `q` and `Q` in Helix mode so they record / replay macros per Helix defaults instead of leaking Vim bindings. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This was referenced Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Helix inverts Vim's macro keys:
Qstarts/stops recording,qreplays. Currently both leak through to Helix mode from the catch-allVimControl && !menusection using Vim's mapping, so Helix users hittingQto record a macro instead get playback, and vice versa.Helix's default keymap explicitly chooses this inversion — the Vim mapping is even present as a commented-out alternative in helix-term/src/keymap/default.rs:
Before
qreplay_macrovim::ToggleRecordQrecord_macro(start/stop)vim::ReplayLastRecordingAfter
qvim::ReplayLastRecordingshift-qvim::ToggleRecordRefs https://docs.helix-editor.com/keymap.html
Refs #4642
Bounty: https://app.opire.dev/issues/01J6HJZCK02FVD4XG900FY36EE
Release Notes:
qandQin Helix mode so they record / replay macros per Helix defaults instead of leaking Vim bindings.