nvim-treesitter-textobjects icon indicating copy to clipboard operation
nvim-treesitter-textobjects copied to clipboard

(comment) for global.

Open fovj opened this issue 3 years ago • 1 comments

I found that comments in most languages can be queried with (comment), Although only tested css, javascript, go, php, vue, I believe for comments, mostly the same (comment).

But now if want to add a query for (comment) for each language, you can only modify each file, which is tedious.

Is it possible to add a global filetype so that each language can apply the query inside.

图片

fovj avatar Apr 19 '22 19:04 fovj

https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/e0d2c72894db60001650b36357d3480f17e1c340/queries/javascript/textobjects.scm#L1

As you can see, javascript queries are inherited from other languages. Maybe you can use this to define sets of global queries and inherit them?

kiyoon avatar Dec 16 '22 14:12 kiyoon