Since plugins's config is in config field of _G.packer_plugins, we could use it directly if the type of config field is fnction. Otherwise, the compiled config string could be appear twice in packer_compiled.lua.
Result:
-- Config for: monokai.nvim
time([[Config for monokai.nvim]], true)
try_loadstring(_G.packer_plugins["monokai.nvim"].config[1], "config", "monokai.nvim")
time([[Config for monokai.nvim]], false)
This doesn't impact if the type of config field is string, so it works as expect.
Since plugins's config is in
config
field of_G.packer_plugins
, we could use it directly if the type ofconfig
field is fnction. Otherwise, the compiled config string could be appear twice inpacker_compiled.lua
.Result:
This doesn't impact if the type of
config
field is string, so it works as expect.