Skip to content

vim: Fix g i and g a in Helix mode to match Helix semantics#57621

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

vim: Fix g i and g a in Helix mode to match Helix semantics#57621
smitbarmase merged 2 commits into
zed-industries:mainfrom
crazydude123:helix-goto-fix

Conversation

@crazydude123

Copy link
Copy Markdown

In Helix mode, g i and g a currently leak through from the catch-all
VimControl && !menu section:

  • g i fires vim::InsertAtPrevious (Vim's "go to last insert"), but Helix's goto_implementation expects an LSP jump to the implementation site.
  • g a fires editor::SelectAllMatches, but Helix's goto_last_accessed_file expects to jump to the alternate buffer.

This adds explicit overrides in the shared (vim_mode == helix_normal || vim_mode == helix_select) section so both keys behave per Helix's documented goto-mode bindings: https://docs.helix-editor.com/keymap.html

Before

Key Helix expects (goto_*) Zed actual (leaked from Vim)
g i goto_implementation (LSP) vim::InsertAtPrevious
g a goto_last_accessed_file editor::SelectAllMatches

After

Key Action
g i editor::GoToImplementation
g a pane::AlternateFile

Refs #4642

Bounty: https://app.opire.dev/issues/01J6HJZCK02FVD4XG900FY36EE

Release Notes:

  • vim: Fixed g i and g a in Helix mode to invoke goto_implementation and goto_last_accessed_file instead of leaking Vim-mode bindings.

In Helix mode, `g i` and `g a` currently leak through from the catch-all
`VimControl && !menu` section:

  - `g i` fires `vim::InsertAtPrevious` (Vim's "go to last insert"),
    but Helix's `goto_implementation` expects an LSP jump.
  - `g a` fires `editor::SelectAllMatches`, but Helix's
    `goto_last_accessed_file` expects to jump to the alternate buffer.

This adds explicit overrides in the shared
`(vim_mode == helix_normal || vim_mode == helix_select)` section so
both keys behave per Helix's documented goto-mode bindings:

  https://docs.helix-editor.com/keymap.html

Refs zed-industries#4642
@cla-bot

cla-bot Bot commented May 25, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @crazydude123 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@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
@crazydude123

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot

cla-bot Bot commented May 25, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @crazydude123 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot

cla-bot Bot commented May 25, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@crazydude123

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 25, 2026
@cla-bot

cla-bot Bot commented May 25, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@smitbarmase smitbarmase added the area:parity/helix Feedback for Helix parity features label 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! Make sense.

@smitbarmase smitbarmase assigned smitbarmase and unassigned kubkon May 26, 2026
@smitbarmase smitbarmase enabled auto-merge May 26, 2026 14:05
@smitbarmase smitbarmase added this pull request to the merge queue May 26, 2026
Merged via the queue into zed-industries:main with commit 16ae765 May 26, 2026
32 checks passed
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 2, 2026
…industries#57621)

In Helix mode, `g i` and `g a` currently leak through from the catch-all
`VimControl && !menu` section:

- `g i` fires `vim::InsertAtPrevious` (Vim's "go to last insert"), but
Helix's `goto_implementation` expects an LSP jump to the implementation
site.
- `g a` fires `editor::SelectAllMatches`, but Helix's
`goto_last_accessed_file` expects to jump to the alternate buffer.

This adds explicit overrides in the shared `(vim_mode == helix_normal ||
vim_mode == helix_select)` section so both keys behave per Helix's
documented goto-mode bindings: https://docs.helix-editor.com/keymap.html

### Before
| Key | Helix expects (`goto_*`) | Zed actual (leaked from Vim) |
| --- | --- | --- |
| `g i` | `goto_implementation` (LSP) | `vim::InsertAtPrevious` |
| `g a` | `goto_last_accessed_file` | `editor::SelectAllMatches` |

### After
| Key | Action |
| --- | --- |
| `g i` | `editor::GoToImplementation` |
| `g a` | `pane::AlternateFile` |

Refs zed-industries#4642

Bounty: https://app.opire.dev/issues/01J6HJZCK02FVD4XG900FY36EE

### Release Notes:

- vim: Fixed `g i` and `g a` in Helix mode to invoke
`goto_implementation` and `goto_last_accessed_file` instead of leaking
Vim-mode 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