Skip to content

vim: Swap q/Q in Helix mode to match Helix macro semantics#57622

Merged
smitbarmase merged 2 commits into
zed-industries:mainfrom
crazydude123:helix-macros-fix
May 26, 2026
Merged

vim: Swap q/Q in Helix mode to match Helix macro semantics#57622
smitbarmase merged 2 commits into
zed-industries:mainfrom
crazydude123:helix-macros-fix

Conversation

@crazydude123

Copy link
Copy Markdown

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:

"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 #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.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 25, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label May 25, 2026
@smitbarmase smitbarmase added the area:parity/helix Feedback for Helix parity features label May 25, 2026
@smitbarmase smitbarmase assigned kubkon and smitbarmase and unassigned kubkon May 25, 2026

@smitbarmase smitbarmase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I tested it. This behavior makes sense.

@smitbarmase smitbarmase enabled auto-merge May 26, 2026 11:19
@smitbarmase smitbarmase disabled auto-merge May 26, 2026 11:19
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
@smitbarmase smitbarmase added this pull request to the merge queue May 26, 2026
Merged via the queue into zed-industries:main with commit 511d2c4 May 26, 2026
32 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:parity/helix Feedback for Helix parity features cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants