-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vim: Add sneak motion #22793
vim: Add sneak motion #22793
Conversation
Implement support for the vim sneak motion from the vim-sneak plugin. The motion jumps forward or backward to any location specified by two characters. The Sneak & SneakBackward operators are bound to 'z' and 'Z' by default to avoid overwriting the 's' and 'S' default keybindings, similar to the way the original plugin uses 'z' with operators to avoid conflicts. Reference: https://github.com/justinmk/vim-sneak
We require contributors to sign our Contributor License Agreement, and we don't have @nilehmann on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
@nilehmann Thanks for taking the time to clean this up! I pushed a few minor tweaks, and will merge when green |
How do I use this? I'm on 168.3 but can't find/see any sneak option in the default vim keymap. |
@jmagaram This will first appear in 0.170 (which will likely go to preview on Wednesday, and stable one week later). |
Thanks for adding this feature, maybe my understanding of "smartcase" being set to true is wrong but if smart case is set to true and I type |
Your understanding is correct and that's the behavior I'm seeing. Do you have |
I did not have this, thank you, it works now. |
Is there a plan to add streak mode for this? If streak mode existed the demand for something like easymotion would be limitted. |
No plans, but if you want to help implement it I'd happily pair: https://calendly.com/conradirwin/pairing |
Hello! I am newbie in vim mode, I already have "vim": {
"enable_vim_sneak": true,
"use_system_clipboard": "never"
} Maybe I need to set up keybinds, but I don't know good solution for that )). update: I tried to set up the next: {
"context": "Editor && vim_mode == visual && !VimWaiting && !VimObject",
"bindings": {
"s": "vim::Sneak",
"S": "vim::SneakBackward"
}
}, but it does change nothing. |
[
{
"context": "vim_mode == normal || vim_mode == visual",
"bindings": {
"s": ["vim::PushOperator", { "Sneak": {} }],
"S": ["vim::PushOperator", { "SneakBackward": {} }]
}
}
] If that's not working you've, and you're editing the correct document, then you've likely either (a) got a syntax break somewhere, which will retain previous keybinds and just not update (can be confusing) or (b) have competing keybinds somewhere (you can try |
Thank you for this, after the recent Easymotion implementation was turned down, having this now is the next best thing :) Working great, except that ctrl-o does not seem to return to the starting point? |
Thank you for making this! |
How do I enable the highlighting? |
Highlighting is not yet supported! I think we could add something with the existing editor.highlight_background API. If you want to pair with me on this: https://cal.com/conradirwin/pairing |
A (re)continuation of #21067.
This takes the original implementation in #15572 and adds the test in #21067. Then, as requested in #21067 (comment), it documents how to map a keybinding instead of having a setting.
Closes #13858
Release Notes:
Sneak
andSneakBackward
operators.Reference:
https://github.com/justinmk/vim-sneak