context.vim
context.vim copied to clipboard
Using treesitter on neovim?
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.
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 thanks for correcting links.
Seems like someone just started implementing it: https://github.com/vigoux/treesitter-context.nvim
Very cool, thanks for sharing 🙌
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.

Just want to say that the linked pull request for the WinScrolled autocmd has been merged
Oh that's great, thanks for the heads up 👍