add back ability to remove plugins

This commit is contained in:
zbirenbaum 2022-04-29 01:04:44 -04:00 committed by siduck
parent 36a25ded76
commit 95951c86a9
3 changed files with 11 additions and 0 deletions

View file

@ -26,6 +26,7 @@ M.ui = {
M.plugins = { M.plugins = {
override = {}, override = {},
remove = {},
options = { options = {
packer = { packer = {

View file

@ -92,6 +92,15 @@ M.load_ifExists = function(module)
end end
end end
-- remove plugins defined in chadrc
M.remove_default_plugins = function(plugins)
local removals = require("core.utils").load_config().plugins.remove or {}
if not vim.tbl_isempty(removals) then
for _, plugin in pairs(removals) do plugins[plugin] = nil end
end
return plugins
end
-- merge default/user plugin tables -- merge default/user plugin tables
M.plugin_list = function(default_plugins) M.plugin_list = function(default_plugins)

View file

@ -222,6 +222,7 @@ local plugins = {
}, },
} }
plugins = require("core.utils").remove_default_plugins(plugins)
-- merge user plugin table & default plugin table -- merge user plugin table & default plugin table
plugins = require("core.utils").plugin_list(plugins) plugins = require("core.utils").plugin_list(plugins)