vim: Add sneak motion (#22793)
A (re)continuation of https://github.com/zed-industries/zed/pull/21067. This takes the original implementation in https://github.com/zed-industries/zed/pull/15572 and adds the test in https://github.com/zed-industries/zed/pull/21067. Then, as requested in https://github.com/zed-industries/zed/pull/21067#issuecomment-2515469185, it documents how to map a keybinding instead of having a setting. Closes #13858 Release Notes: - Added support for the popular [vim_sneak](https://github.com/justinmk/vim-sneak) plugin. This is disabled by default and can be enabled by binding a key to the `Sneak` and `SneakBackward` operators. Reference: https://github.com/justinmk/vim-sneak --------- Co-authored-by: Kajetan Puchalski <kajetan.puchalski@tuta.io> Co-authored-by: Aidan Grant <mraidangrant@gmail.com> Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
0d6a549950
commit
0b105ba8b7
5 changed files with 301 additions and 5 deletions
|
@ -408,6 +408,20 @@ Vim mode comes with shortcuts to surround the selection in normal mode (`ys`), b
|
|||
}
|
||||
```
|
||||
|
||||
The [Sneak motion](https://github.com/justinmk/vim-sneak) feature allows for quick navigation to any two-character sequence in your text. You can enable it by adding the following keybindings to your keymap. By default, the `s` key is mapped to `vim::Substitute`. Adding these bindings will override that behavior, so ensure this change aligns with your workflow preferences.
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"context": "vim_mode == normal || vim_mode == visual",
|
||||
"bindings": {
|
||||
"s": ["vim::PushOperator", { "Sneak": {} }],
|
||||
"S": ["vim::PushOperator", { "SneakBackward": {} }]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Restoring common text editing keybindings
|
||||
|
||||
If you're using vim mode on Linux or Windows, you may find it overrides keybindings you can't live without: `ctrl+v` to copy, `ctrl+f` to search, etc. You can restore them by copying this data into your keymap:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue