-
Notifications
You must be signed in to change notification settings - Fork 287
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
feature: Allow plugins to configure their own laziness #338
Comments
Perhaps there should be a new option, Alternatively, it could require setting |
Another thing I forgot to mention is if we should let this functionality manage dependencies (I think we shouldn't, it's too easy to screw up and doesn't account for non-plugin dependencies). |
That's already planned. |
Ah, my bad. |
@folke, if you need help implementing this, I'm more than willing to help. |
I first need to think this through to keep everything performant. I would actually allow using these files even when the default for lazy is false, since if something's not working due to lazy-loading, it's the plugin dev that needs to fix it anyway. I'll keep this issue open for now. |
I'm also looking to support https://github.com/nvim-lua/nvim-package-specification directly. |
Did you check the docs?
Is your feature request related to a problem? Please describe.
Sometimes, setting up Lazy to use lazy-loading can be a little repetitive. The user needs to find a list of commands for the plugin, and then they need to specify them all. This isn't very resilient to plugin updates where commands are added or removed.
Describe the solution you'd like
Plugin developers should be able to specify a file in
lua/lazy/_automatic/<pluginName>.lua
1which getsrequire
d2 by Lazy itself. The automatic setup file should return a table with all of the Lazy triggers:cond
,event
,cmd
, andft
. It should not be able to set anything else, includingpriority
.This automatic setup should only be triggered if
lazy
is set totrue
. User-specified values should overwrite pre-determined values.Describe alternatives you've considered
See "Is your feature request related to a problem".
Additional context
The trouble with this is finding a way to use "path safe" plugin names, as
require
interprets a dot.
as a slash/
.Footnotes
I modeled the name after Telescope's
_extensions
submodule. It can be whatever. ↩Something like
require("lazy._automatic" .. pluginName)
would work, plus it looks clean. ↩The text was updated successfully, but these errors were encountered: