Closed metal3d closed 4 weeks ago
Initializing a lua module with .setup()
is a loose convention for lua modules, and setup calls can be quite heavy depending on the plugin. Implicitly calling setup by default is also assuming every plugin with one should not be lazy loaded.
Adding config = true
like so does the same thing as opts = {}
:
return {
{
"icewind/ltex-client.nvim",
config = true
},
}
I agree, it's only that it is a bit confusing when a module isn't loaded after declaring its installation.
Not all plugins use setup
and it's also not always wanted to call setup automatically.
Lazy only calls setup when opts
is present.
Did you check the docs?
Is your feature request related to a problem? Please describe.
As mentionned here: https://github.com/LazyVim/LazyVim/issues/4661 it is a bit confusing, sometimes, to realize why a plugin is not entirely loaded if we didn't set
config
oropts
directive.For example, I loaded this plugin:
But no command from the plugin were found.
If I do:
So the commands are now present.
Describe the solution you'd like
When no
opts
orconfig
is set, Lazy should callsetup()
unless an option tells to not do it.Describe alternatives you've considered
At this time, no alternative. I need to set
config
oropts
to empty object.Additional context
Using LazyVim 😄 and I love it 😉