config = function() VS. opt = {} VS. opt = function() #2129
-
|
Hi! I am unsure when to use which? I do not know the difference even after reading the doc. I am very new to this. I haven't been able to find a good answer anywhere so hopefully you guys would be able to answer. Thank you so much!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
If you're using your own custom config it doesn't matter which one you will use. If you use some distro, then you should always use
See also #2096 where I gave an example of what happens with plugin |
Beta Was this translation helpful? Give feedback.
If you're using your own custom config it doesn't matter which one you will use. If you use some distro, then you should always use
optsand avoidconfig(unless you know explicitly what you're doing and you're certain you won't break things, but since you're new and don't know the difference you should definitely avoid it). The reason being that different instances ofoptswill get merged together, but the same thing will not happen when you useconfig. The latestconfigdefined will overwrite the previous ones.optsis essentially the table of configuration that each plugin gets and that is passed to the defaultconfigfunction, which by default doesrequire("main_lua_module).setup(opts).…