Replies: 2 comments 2 replies
-
You can override built-in require('mini.ai').setup({
custom_textobjects = {
t = { '<(%w-)%f[^<%w][^<>]->.-</%1>', '^<.->%s*().*()%s*</[^/]->$' },
}
}) Then use linewise selection with |
Beta Was this translation helpful? Give feedback.
-
@echasnovski: as a follow-up to this, is there a way to make vit/cit use nvim-treesitter-textobject's for tag changing/selection/operations instead of of the capture group way from the mini.ai plugin? the reason being is, with elixir and heex templates you can define custom html tags that ultimately point to an elixir function, so here's the impl of the textobject query for the heex filetype: https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/master/queries/heex/textobjects.scm |
Beta Was this translation helpful? Give feedback.
-
Example below: I want to select only 2 lines with <p> tags when the cursor is somewhere on <div> or </div>
Beta Was this translation helpful? Give feedback.
All reactions