context.vim icon indicating copy to clipboard operation
context.vim copied to clipboard

Using treesitter on neovim?

Open xaljer opened this issue 5 years ago • 7 comments
trafficstars

Thanks author for context.vim first, i think it's really cool! I also use treesitter on neovim by https://github.com/nvim-treesitter/nvim-treesitter. And I think it may be suitable to implement the feature of context.vim. Since treesitter already parse code to AST, we should get the context naturally. And this may more efficient than regular expressions. Further more, This way should remain the highlight of the header line of context i think, instead of using a separate highlight. I also opened an issue at https://github.com/nvim-treesitter/nvim-treesitter/issues/358.

xaljer avatar Aug 30 '20 03:08 xaljer

Thank you for opening this issue! I probably won't have time to look into this in detail anytime soon, but it seems very interesting.

Btw, on another note you got your links wrong, I had to fix them to make them work. Below are the ones you had used, try clicking on them. :v:

https://github.com/nvim-treesitter/nvim-treesitter https://github.com/nvim-treesitter/nvim-treesitter/issues/358

wellle avatar Aug 30 '20 21:08 wellle

@wellle thanks for correcting links.

xaljer avatar Aug 31 '20 17:08 xaljer

Seems like someone just started implementing it: https://github.com/vigoux/treesitter-context.nvim

ThomasFeher avatar Sep 01 '20 17:09 ThomasFeher

Very cool, thanks for sharing 🙌

wellle avatar Sep 01 '20 22:09 wellle

This implementation is more complete: https://github.com/romgrk/nvim-treesitter-context

It won't work as well as the screencast below for you though, I have compiled my neovim with https://github.com/neovim/neovim/pull/13117 that implements a Scroll autocmd. No idea how long it will take to be reviewed & merged though.

demo

romgrk avatar Oct 20 '20 23:10 romgrk

Just want to say that the linked pull request for the WinScrolled autocmd has been merged

AdnoC avatar Dec 26 '20 22:12 AdnoC

Oh that's great, thanks for the heads up 👍

wellle avatar Dec 26 '20 23:12 wellle