vim: subword motions (#8725)

Add subword motions to vim, inspired by
[nvim-spider](https://github.com/chrisgrieser/nvim-spider),
[CamelCaseMotion](https://github.com/bkad/CamelCaseMotion).


Release Notes:

- Added subword motions to vim
This commit is contained in:
Rom Grk 2024-03-07 21:36:12 -05:00 committed by GitHub
parent 467a179837
commit d247086b21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 491 additions and 93 deletions

View file

@ -88,6 +88,22 @@ You can see the bindings that are enabled by default in vim mode [here](https://
The details of the context are a little out of scope for this doc, but suffice to say that `menu` is true when a menu is open (e.g. the completions menu), `VimWaiting` is true after you type `f` or `t` when were waiting for a new key (and you probably dont want bindings to happen). Please reach out on [GitHub](https://github.com/zed-industries/zed) if you want help making a key bindings work.
## Subword motion
Subword motion is not enabled by default. To enable it, add these bindings to your keymap.
```json
{
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
"w": "vim::NextSubwordStart",
"b": "vim::PreviousSubwordStart",
"e": "vim::NextSubwordEnd",
"g e": "vim::PreviousSubwordEnd"
}
},
```
## Command palette
Vim mode allows you to enable Zeds command palette with `:`. This means that you can use vim's command palette to run any action that Zed supports.