Setting up mini.ai
alongside nvim-treesitter-textobjects
and setting up treesitter fallbacks
#970
-
Hi! I'm trying to setup treesitter-based textobjects using I was also wondering if it is possible to setup "fallbacks" when treesitter isn't available. In buffers with treesitter support, I would for example like to use query from treesitter for calls, whereas in non-treesitter buffers, I would like to fallback to regex-based definitions. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello!
Both of those options don't look like adding too much of a feature set, to be honest.
The
Not quite fallbacks, but you can disable 'mini.ai' textobject per buffer. For this, create a Besides that you'd have to write your own textobject in function form. |
Beta Was this translation helpful? Give feedback.
Hello!
Both of those options don't look like adding too much of a feature set, to be honest.
include_surrounding_whitespace
might be useful, but mostly feels like an ad hoc patch that fixes the tree-sitter grammar implementation rather that the problem itself.The
selection_modes
seems available in 'mini.ai' viavis_mode
field of a textobject specification. But it seems to only be present for manual specifications, whilegen_spec.treesitter()
can not forward this information.…