# vim: Swap q/Q in Helix mode to match Helix macro semantics \(\#57622\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/511d2c43d2ae747d977250f6ede23e9a57ce83a0)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 511d2c43d2ae747d977250f6ede23e9a57ce83a0

Requested commit: 511d2c43d2ae747d977250f6ede23e9a57ce83a0

Commit: 511d2c43d2ae747d977250f6ede23e9a57ce83a0

Tree: 5ca143eb799b74d1c748d81d7fbb6a7e8133cebd

Author: crazydude123

Committer: GitHub

## Message

````
vim: Swap q/Q in Helix mode to match Helix macro semantics (#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 #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>
````

## Parents

- [1a0b54616bc4aa547272f9bef6ac244f372f84fd](https://git.cafe/gitcafe/zed/commit/1a0b54616bc4aa547272f9bef6ac244f372f84fd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/511d2c43d2ae747d977250f6ede23e9a57ce83a0?format=markdown)
