How does Lazy.nvim go about loading plugins? #2123
Universal-Invariant
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm wanting to write a bisect utility for plugins and rather than try to modify files I though it would be a nice idea to simply require plugins in the plugins dir and add enable to them before lazy.nvim loads the plugins.
I figured that lazy.nvim was likely using require on the files and I could "pre-require" them and modify the table and the cache would take care of the rest. This doesn't seem to work for some reason. I haven't been able to figure out exactly what lazy.nvim is doing to load the files but it seems to delete any caching of such files before it tries to load or it is not using require. The enable flag does not persist after I add it suggesting it is not as simple as I thought.
Do you remember how you load the plugins? Is it using require but clearing any caching of require? Is there some way to disable plugins? E.g., is there something in the main spec that can be used like a list of plugin names to disable(then I can simply generate and add to the table before it's called).
There is clearly some disabled logic in lazy.nvim but I'd like to go about it the most non-invasive and simple way and ideally not have to fork lazy.nvim to get it to work.
I guess the easiest way, if you can't offer any help, would be to hijack { import = "plugins" }, and move files around but this is a bit too blunt since a file might contain several plugins. I'm trying to avoid editing the plugin files since this is error prone.
If there was a "disable" field in the spec then I could simply generate the plugin names list quite easily. I can add the feature if if it doesn't exist and you are willing to merge it.
Beta Was this translation helpful? Give feedback.
All reactions