-
Notifications
You must be signed in to change notification settings - Fork 237
mini.breadcrumbs plugin to show breadcrumbs of current cursor position using treesitter. #983
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
Comments
Thanks for the suggestion! I like the idea of this "breadcrumbs" like functionality. My concern is about implementing it efficiently. Having to do more LSP requests on every text change (which I'd imagine what 'nvim-navic' has to do) is hard to do efficiently. Relying on 'nvim-treesitter' is not an option. Besides, I try to stay away from both LSP specifications and tree-sitter because working with them is a challenge for me. I'll think about it. |
+1 on breadcrumbs Many people don't use tabs, and the breadcrumbs are awesome in big files with a lot of nesting. I've been using this guy these past few years: barbecue.nvim — it's awesome and gets the job done — but it's an archived wrapper around navic, and I wouldn't mind removing one more plugin in favor of a well-thought-out mini module. I don't have much to add to the above discussion, if I were to implement it myself, I would most likely succumb to treesitter. Appreciate you. |
Hmm, that sounds like dropbar. I use dropbar quite a lot and I support the idea of breadcrumbs.. |
Hi @echasnovski, I"m a loyal fan of mini and have integrated many mini modules into my configuration. I"m thrilled to see mini keep improving! Just sharing my personal thoughts here - no other intentions. If you"re genuinely interested in breadcrumbs but concerned about performance, you might want to check out this single-file implementation I created (referencing two great projects: barbecue.nvim and dropbar.nvim) at: https://github.com/ngpong/dotfiles/blob/main/.config/nvim/lua/ngpong/core/winbar.lua. This mini breadcrumb already includes essential features, using LSP as the source while maintaining updates between 20-50µs. For simplicity, here are the core principles:
Disclaimer: I take no maintenance responsibility for this code. While it works for my specific needs, you may need to adapt it for your environment. That said, simple modifications should be easily integrable into your own configuration. Additional Note: While Tree-sitter could theoretically deliver better results, using it as source isn't reliable. It requires meticulous organization of relationships between returned nodes, and there's a high likelihood it would fail to meet performance expectations. Best regards. |
Thanks for the suggestion! My thoughts for optimizing this would have been to use coroutines to make it more non-blocking. I thought about breadcrumbs-like functionality after diving into LSP lately, but still not sure if it'll be worth it. I personally don't use winbar (which is a perfect and reasonably only way to show this type of information), so it doesn't have high priority. But that reference file will be handy as a reference for the future, thanks! |
Yeah, that's possible, but I prefer (and would like to suggest to users) to have file name shown in the window. Working with several split windows without it is not fun. |
Contributing guidelines
Module(s)
mini.breadcrumbs
Description
Is there any plan on adding something like nvim-navic to the mini.nvim suite of plugins. For getting breadcrumbs we can leverage treesitter or lsp as nvim-navic does or use nvim_treesitter#statusline() to get the current context and parse it accordingly into proper format.
The text was updated successfully, but these errors were encountered: