add condition to merge user custom plugins

This commit is contained in:
siduck 2023-02-17 22:25:31 +05:30
parent 861e9ed3ae
commit b37a1bdee7
2 changed files with 11 additions and 5 deletions

View File

@ -74,7 +74,9 @@ M.ui = {
},
}
M.plugins = {}
M.plugins = "" -- path i.e "custom.plugins" -> custom/plugins.lua only and not custom/plugins/init.lua!!!!
M.lazy_nvim = {} -- config for lazy.nvim startup options
-- these are default mappings, check core.mappings for table structure
M.mappings = require "core.mappings"

View File

@ -221,11 +221,15 @@ local default_plugins = {
require("which-key").setup(opts)
end,
},
{ import = require("core.utils").load_config().plugins },
}
-- load lazy.nvim _,opts
local lazy_config = require "plugins.configs.lazy_nvim"
local config = require("core.utils").load_config()
if #config.plugins > 0 then
table.insert(default_plugins, { import = config.plugins })
end
-- lazy_nvim startup opts
local lazy_config = vim.tbl_deep_extend("force", require "plugins.configs.lazy_nvim", config.lazy_nvim)
require("lazy").setup(default_plugins, lazy_config)