-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add find in next command for character pairs #11124
Add find in next command for character pairs #11124
Conversation
I think it would be useful to have a way to select the next pairing of a certain kind (or of any kind), but I believe this should belong under To start with it should be a pretty small and self-contained change to add |
The first part makes sense, but I'm just wondering regarding the second bit - how would the |
I'm also thinking that we would drop the i/a part and use "around" like the other Currently there isn't a way to write a command that accepts any character. One solution would be to refactor all of the |
Not sure how ergonomic this is - for instance, if you wanted to select inside the next
Useful to know, thank you for sharing! |
@the-mikedavis sorry to ping on this, just wondering if you had thoughts on my question above about the addition of |
Hi there, To me it feels like the perfect addition to the current behaivor
Im just a newbie, part-time nvim user and hyped helix user but to my limited understanding this would be a nice feature EDIT: AND i forgot to shout out a HUGE HUGE THANK YOU to the people taking the time and creating PRs |
I think that automatically jumping if not already inside matching characters is confusing, as you might not think that you're inside a matching pair and so attempt to jump ahead, but actually you are and so select a wider region than expected. Being explicit should require no extra keypresses ( |
Nothing to complain |
I agree, nuanced behavior like that can be confusing especially when you're working with multiple selections. I'd like to avoid the So |
Sounds good, thanks for clarifying! |
I will work on a new PR based on the implementation discussed here |
Comment the new PR here when you have it ;) |
New PR here: #11260 |
Adds the ability to match inside/around the next matching character pair: for instance, with the cursor as
█
below:typing
min[
would select the contents of the array (i.e.bar
).Screen.Recording.2024-07-10.at.19.46.23.mov
I have only implemented matching in next matching characters (and not the remainder of matching options e.g. word, function etc.) as I wanted to confirm that my approach was okay - once there is agreement on an approach I can implement the remainder, either in this PR or separate PRs.
Partially resolves #10567