Flesh out helix bindings (#28103)

This brings in a bunch of helix bindings (many of them from
infogulch/zed-helix-keymap) and implements helix-style delete.

Release Notes:

- vim: Expanded default helix-style keybindings in HelixNormal mode
This commit is contained in:
jneem 2025-04-05 01:21:15 +07:00 committed by GitHub
parent 558d61b907
commit 435fff94bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 111 additions and 12 deletions

View file

@ -438,7 +438,7 @@ impl Vim {
vim.update(cx, |_, cx| {
Vim::action(editor, cx, |vim, _: &SwitchToNormalMode, window, cx| {
vim.switch_mode(Mode::Normal, false, window, cx)
vim.switch_mode(vim.default_mode(cx), false, window, cx)
});
Vim::action(editor, cx, |vim, _: &SwitchToInsertMode, window, cx| {
@ -739,6 +739,10 @@ impl Vim {
cx.on_release(|_, _| drop(subscription)).detach();
}
pub fn default_mode(&self, cx: &App) -> Mode {
VimSettings::get_global(cx).default_mode
}
pub fn editor(&self) -> Option<Entity<Editor>> {
self.editor.upgrade()
}
@ -1105,7 +1109,7 @@ impl Vim {
}
}
if mode == "normal" || mode == "visual" || mode == "operator" {
if mode == "normal" || mode == "visual" || mode == "operator" || mode == "helix_normal" {
context.add("VimControl");
}
context.set("vim_mode", mode);