# vim: Fix \`g i\` and \`g a\` in Helix mode to match Helix semantics \(\#57621\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 16ae765da82cef3049223f59d78e1e8147407d28

Requested commit: 16ae765da82cef3049223f59d78e1e8147407d28

Commit: 16ae765da82cef3049223f59d78e1e8147407d28

Tree: e7089b23c70c733dc171905cc681661879937efd

Author: crazydude123

Committer: GitHub

## Message

```
vim: Fix `g i` and `g a` in Helix mode to match Helix semantics (#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 #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>
```

## Parents

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

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