Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the context of the currently visible buffer contents à la context.vim #396

Open
CBenoit opened this issue Jun 30, 2021 · 7 comments · May be fixed by #6118
Open

Show the context of the currently visible buffer contents à la context.vim #396

CBenoit opened this issue Jun 30, 2021 · 7 comments · May be fixed by #6118
Labels
A-plugin Area: Plugin system C-enhancement Category: Improvements

Comments

@CBenoit
Copy link
Member

CBenoit commented Jun 30, 2021

Describe your feature request

See context.vim for yourself. I think we may achieve this using tree sitter.

May be built-in or provided by a plugin.

@CBenoit CBenoit added C-enhancement Category: Improvements A-plugin Area: Plugin system labels Jun 30, 2021
@sudormrfbin
Copy link
Member

This is a very useful feature to have, and it'd be nice if we could add it to core. For reference there's a treesitter port of context.vim which I use - https://github.com/romgrk/nvim-treesitter-context

@cessen
Copy link
Contributor

cessen commented Jul 2, 2021

This looks really cool! I don't think it belongs in core, but definitely as a plugin.

@David-Else
Copy link
Contributor

I thought it was amazing in Neovim briefly until I realized it was just a workaround for the bad practice of having modules that are too big. I soon uninstalled it, it is just not needed if you stick to best practices in the first place.

I would also say it is not needed in core along with @cessen . @the-mikedavis I saw on Matrix you were talking about putting it in core, maybe have a discussion in this issue?

@matoous
Copy link
Contributor

matoous commented Sep 7, 2022

Not sure what the decision will be but I wanted to play around with this a bit and got this so far: matoous@b74b298. Personally, I don't see issue with this being part of the core, it's closely coupled to the tree-sitter capabilities helix already provides and it isn't a large effort to have this/maintain it.

The biggest issue I see so far is that it doesn't look great unless only specific tree sitter nodes are used for the context which would mean we would need configuration for the context for every language with tree sitter (or all ndoes could be taken by default and languages could have overrides). Example:

Screenshot 2022-09-07 at 22 39 20

The nodes being source_file, impl_item, function_item, block. (don't mind the line numbers that are off)

@CBenoit
Copy link
Member Author

CBenoit commented Sep 19, 2022

@matoous Cool! I think you should open a PR with that so we can discuss in more details 🙂

@the-mikedavis also said something about that by the way: #2740 (comment)

@matoous matoous mentioned this issue Sep 22, 2022
3 tasks
@matoous
Copy link
Contributor

matoous commented Sep 22, 2022

@CBenoit very rough PR: #3944

@goyalyashpal
Copy link
Contributor

goyalyashpal commented Dec 26, 2022

Search term: sticky scroll for showing the current scope

ref: (in oldest first order)

Python:

MS VSCode: microsoft/vscode#26757

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-plugin Area: Plugin system C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants