You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
config_namespace is rc.config lazy.lua load plugins config like spec = { import = config_namespace .. ".plugins" } pluginX.lua (X is number) are written like return { -- Various plugins settings by lazy config }
return {
-- All plugin with load setting
{ "abc/plugin1.lua"
event = "VimEnter", -- example event
config = function() {
require('rc.plugin-config.plugin1')
}
}, -- other plugin setting like above plugin1 ...
}
pluginX.lua (X is number) are written like require('pluginX'){ -- pluginX config }
Which is better?The only pro/cons I've noticed is that with case2, you can see all the plugins you put in a single file.
I also have another question, if something is installed by dependancy (e.g. extensions by telescope, cmp, etc.),Will the child plugin be lazy loaded according to the parent plugin's event? Or does each child plugin also need to write its own event?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
case1:
config_namespace is rc.config
lazy.lua load plugins config like
spec = { import = config_namespace .. ".plugins" }
pluginX.lua (X is number) are written like
return { -- Various plugins settings by lazy config }
case2:
lazy.lua written like this:
pluginX.lua (X is number) are written like
require('pluginX'){ -- pluginX config }
Which is better?The only pro/cons I've noticed is that with case2, you can see all the plugins you put in a single file.
I also have another question, if something is installed by dependancy (e.g. extensions by telescope, cmp, etc.),Will the child plugin be lazy loaded according to the parent plugin's event? Or does each child plugin also need to write its own event?
Beta Was this translation helpful? Give feedback.
All reactions