-
Notifications
You must be signed in to change notification settings - Fork 3k
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: Support gn command and remap gn to gl #9982
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @joaquin30 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! |
Also the work of @Neptune650 in #9969 could serve for moving the cursor when vim is in normal mode. Edit: I included some of the code of #9969 for searching matches and added basic operator support, |
@joaquin30 @Neptune650 I like that we are re-using the search bar for this. In non-vim mode the default behavior is to select the match, so (maybe?) we can simplify the normal mode version of this to something like:
I see you have code to handle expanding the selection if you're already in visual mode, If it'd be useful I'd happily pair with one or both of you to help get this over the line: https://calendly.com/conradirwin/pairing |
Great to see some of this
Or, sometimes I'll look through the matches with any amount of |
|
@baldwindavid nice catch! I hadn't caught that, but can reproduce, thank you for the heads up |
Couple other things I'm seeing:
|
I was going to comment the same, but also using Edit: This is not related to the number of repetitions, but instead with how fast we are pressing |
For |
Yes, I will do it |
OK, the code is in #10237. There are two issues:
|
@ConradIrwin - Okay, yeah, much better with a release build. I can get it to be sluggish searching |
Makes sense, sorry I had misunderstood what was happening, and I think you're right that we need to stop repeating (though maybe if we wanted to emulate vim better we'd just ignore the next insert/normal switch, this seems fine for now). Pushed a bit of tidy up to your branch, but this should be good to go. |
Release Notes: - Fixed `cgn` backwards movement problem in #9982 There are two issues: - When there are no more matches, the next repetition still moves the cursor to the left. After that, the recording is cleared. For this I simply move the cursor to the right, but it doesn't work when the cursor is at the end of the line. - If `cgn` is used when there are no matches, it cleans the previous recorded actions. Maybe there should be a way to revert the recording. This also happens when using `c` and `esc` --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Release Notes:
gn
andgN
to select the next search result as in vim. Vim: supportgn
command #4273. Adding multi-cursors to the next/prev copy of the word under the cursor is now bound togl
/gL`.@algora-pbc /claim #4273
This is a work-in-progress. The process for
gn
command is:To make this possible, several private members and editor structures are made public.
gN
is not yet implemented and the cursor still does not jump to the next selection in the first use.Maybe there is an better way to do this?