syntax-tree-surfer icon indicating copy to clipboard operation
syntax-tree-surfer copied to clipboard

Allow mappings to queries from nvim-treesitter-textobjects?

Open davidatsurge opened this issue 3 years ago • 2 comments

First off, thanks a bunch for working on this plugin! I absolutely love the possibilities that neovim's treesitter integration opens up, and it's great when you find a plugin that you were thinking that you'd have to code yourself 😂.

Soo, the nvim-treesitter-textobjects plugin has a set of cross-filetype definitions for textobjects/move targets, as summarized here. I was wondering if you'd be interested in allowing syntax-tree-surfer to use these definitions (like @function.outer, .. etc) to define jump targets. I know that syntax-tree-surfer also has other features like swapping and moving, and I don't see anything that prevents these definitions being used there as well, but I am really interested in jumping (like here ).

The advantage of using the definitions from nvim-treesitter-textobjects is that we build upon the work did there to define a consistent definition of a function/ a class/an if statement/..etc across many files.

davidatsurge avatar Jun 20 '22 20:06 davidatsurge

That is a great idea. Although I’m not familiar with that area of treesitter (will need to learn). It will take some time but if it makes life easier for people, I’ll try to implement it.

ziontee113 avatar Jun 21 '22 06:06 ziontee113

I’m curious, how would you / other people you use such a feature?

ziontee113 avatar Jun 21 '22 06:06 ziontee113