Skip to content
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

Allow multiple queries for select to increase configurability #555

Open
mehalter opened this issue Jan 24, 2024 · 1 comment
Open

Allow multiple queries for select to increase configurability #555

mehalter opened this issue Jan 24, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@mehalter
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Some select text objects I don't want to map to their own individual keys and would rather just take the first one available from a list of queries.

Describe the solution you'd like
Similar to the move and swap text objects, it would be amazing to supply regex or a list of queries to a select text object. That way we can bind several queries easily to a single keymap.

Describe alternatives you've considered
I'm not sure if there is any other alternative other than just mapping each query to it's own mapping

Additional context
I'm curious if there is an architectural limitation that kept this from being implemented in the first place when multiple query support was added to move and swap. Plugins like mini.ai have support for utilitizing the nvim-treesitter-textobjects queries to construct select mappings with multiple queries which leads me to believe it should be doable here as well.

Thanks so much for everyone's work here maintaining and developing this plugin, it is a godsend!

@mehalter mehalter added the enhancement New feature or request label Jan 24, 2024
@LJFRIESE
Copy link

This is what mini.ai does. It uses a series of helper functions to facilitate iterating through the table of supplied node types. I would love to see this here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants