-
-
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 a variant of sub-selection (s
) that uses textobjects instead of regex
#3007
Comments
Hi @the-mikedavis |
Sweet! I think the changes for #3263 will end up being separate from this so I don't think we'll step on each others' toes 🙂 |
For keybinds, I wonder if the existing behavior of |
I would love to see this, @CBenoit did you make any progress on this otherwise I might take this on soonish (altough I quite a few other things I want to finish first)
I would rather see this as a seperate keybinding. |
I would suggest |
Figuring out a good keybind for this is tricky. I have a slight preference for putting this under |
I think it could be very ergonomic to be able to have a selection broken down by tree-sitter driven textobjects that can give us commonly desired selections.
Consider a selection like the following:
If you want to select all parameters to the function, say so you could reorder them with
Alt-)
or append a new line to each to begin reformatting them, you would need to split on spaces withS <enter>
, but this will incorrectly split the selection where the default value is defined, and where the typehint is included.With this proposal, you could enter the new subselection mode (keybind to be determined), and enter
a
meaning the textobject for parameters/arguements, resulting in the following selections:Similar to the
mi
/ma
and]
/[
binds, this new bind would show an autoinfo of possible textobjects, rather than prompting for a regex as the currents
andS
keybind does.The text was updated successfully, but these errors were encountered: