zed
zed copied to clipboard
vim: Fix escape key switching back to default mode instead of normal mode
Closes #31728
When "default_mode: "insert", hitting escape was not switching to normal mode. Recently, changes to SwitchToNormalMode action was modified to change mode into default_mode instead or actually switching to Normal mode. Same with the NormalBefore
Release Notes:
- Fixed - escape key not switching to normal mode when default_mode is insert
We've gotten a bit muddled up with default_mode, as that is also how helix mode is enabled.
Cross positing from https://github.com/zed-industries/zed/pull/28103#issuecomment-2931997745
I think the right fix here is:
{"vim": {"default_mode": ""}}should be the mode you start in by default (expected to be"normal"or"insert"){"helix_mode": true}should be added as a top level key. If it is enabled, then vim_mode is also enabled, and when switching to normal mode, vim picks Helix normal instead of Vim normal.
Happy to pair on this (https://cal.com/conradirwin/pairing), or if you want to take a pass at it, feel free.
I already have a working prototype which uses "helix_mode": true but inside the vim settings.
My concerned is what happens when user has "helix_mode": true on top level but also has "vim_mode": false?
For now, I will enable vim_mode when helix_mode is enabled.
That sounds right to me, thanks!
@ConradIrwin I have added helix_mode settings as we discussed.
Thanks for this, and sorry for the slow response! I've merged this into the vim mode setting crate (As a large number of crates causes slowness, it seemed better to have one tiny one than two).
Will merge when tests pass.
When I press d for deleting a character I end up in vim normal mode instead of helix normal