Dynamic registration of custom cmdline completion source with docs
Feature Description
Hi again @Saghen and ty for your hard work, you're a machine :-)
Background: when fzf-lua detects nvim-cmp cmdline completion it will register itself as a custom source with docs, this feature is quice nice as it allows the user to see the option they are about to use and it's potential values, etc.
This is how it looks like:
Apologize in advacne if I missed anything in the docs, how would I go about the entire process of:
- Registering a custom cmdline source (dynamically at runtime, without having it defined in blink's setup)
- Adding docs to the custom source so those are displayed with blink
Seems interesting! We have the add_provider method but the user would need to explicitly add the source to their cmdline list, so we need a couple things for this:
- [ ] Ability to show documentation window in cmdline mode (shouldn't be difficult, just need to hook up the redrawing)
- [x] Ability for plugins to enable a source outside of the user's config
Ty @Saghen that would be amazing, no rush on this definitely in the “nice to have” category :)
@Saghen I think it would be very useful to add and register a source at runtime without requiring manual user configuration, especially since some plugins—like Neorg—have their own way of loading and integrating with external plugins.
I’m currently working on integrating Neorg with Blink Completion, but due to some architectural conflicts between the two, it’s proving to be extremely difficult—if not nearly impossible—to get everything working smoothly.
@std-enigma It's already possible to register your source dynamically and enable it for a specific filetype via: https://github.com/Saghen/blink.cmp/blob/main/lua/blink/cmp/init.lua#L381