[Feature] option to disable calling `setup`
It is not necessary to call the setup for every plugin, so is it possible to add a boolean to control this in nixvim?
Technically, you could do plugins.foo.luaConfig.content = lib.mkForce "".
However, I would be curious to know for which plugin(s) we are calling the setup function unnecessarily.
thank you
However, I would be curious to know for which plugin(s) we are calling the setup function unnecessarily.
for example, fff-nvim and blink-indent
We should probably add an "optional" value to callSetup that makes it so it is only called when settings is set. There are a bunch of especially newer plugins that use this optional setup pattern.
Yeah, I like that. If we don't need to call setup, it would be preferred to avoid injecting it into the init.lua needlessly.
We should probably add an "optional" value to
callSetupthat makes it so it is only called whensettingsis set. There are a bunch of especially newer plugins that use this optional setup pattern.
Sure, but there is a nuance to that.
When calling setup is necessary for initializing the plugin (whether or not settings is empty), we should definitely do it. AFAIK, this is the case for most plugins.
Maybe we could expose a user-facing callSetup toggle for all plugins.
plugins.foo = {
enable = true;
callSetup = false;
};
- We should make sure that
settingscannot be non-empty ifcallSetupis disabled (assertion or at least warning) - We could set the default value of
callSetupper plugin (maybe defaulting totrue). If we know thatfoodoes not require itssetupfunction to be called when nosettingsare provided, then we could setplugins.foo.callSetuptofalseby default.