-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Beam Jump - Lightning Fast Vim style navigation #45387
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
base: main
Are you sure you want to change the base?
Conversation
ecstatic-morse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not part of Zed, just a user who is excited about this functionality finally landing. I tried this locally and it looks great!
I pretty much exclusively use easy motion's bidirectional mode, so it's a little disappointing to see that part missing. It doesn't work as nicely with ;, but it's faster than having to decide between forward and backward before starting a jump.
| ]; | ||
|
|
||
| #[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
| pub(crate) enum BeamJumpDirection { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to reuse workspace::searchable::Direction for this.
| const BASE_LABEL_CHARS: &[char] = &[ | ||
| 'f', 'j', 'd', 'k', 's', 'l', 'a', 'g', 'h', 'r', 'u', 'e', 'i', 'o', 'w', 'm', 'n', 'c', 'v', | ||
| 'x', 'z', 'p', 'q', 'y', 't', 'b', | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to let the user configure this in case they don't use QWERTY.
| fn reverse_beam_jump_direction(direction: BeamJumpDirection) -> BeamJumpDirection { | ||
| match direction { | ||
| BeamJumpDirection::Forward => BeamJumpDirection::Backward, | ||
| BeamJumpDirection::Backward => BeamJumpDirection::Forward, | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already a method on workspace::searchable::Direction
| if VimSettings::get_global(cx).beam_jump { | ||
| vim.start_beam_jump(BeamJumpDirection::Forward, action.first_char, window, cx); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kind of strange to reuse the PushSneak operators here. It means the user can't one mapping for sneak and another for beam jump. Is there a reason you can't introduce new operators just for beam jump?
Closes #14801, #4930
Summary:
Description:
BeamJumpState, label assignment, and motion logic, plus viewport-scoped match tracking and global fallback search.Release Notes: