fix(plugins): ensure defaults for add

This commit is contained in:
Matt Leong 2021-10-25 20:15:00 -07:00
parent b377cf8c09
commit f7ca86256a
2 changed files with 9 additions and 2 deletions

View file

@ -1,6 +1,8 @@
-- Add additional plugins as well as disable some core plugins -- Add additional plugins as well as disable some core plugins
--[[ local plugins = { --[[
local plugins = {
add = { add = {
'ggandor/lightspeed.nvim', 'ggandor/lightspeed.nvim',
{ {
@ -22,4 +24,5 @@
} }
return plugins return plugins
]] ]]

View file

@ -15,10 +15,14 @@ end
if user_plugins == true then if user_plugins == true then
user_plugins = { user_plugins = {
add = {},
disable = {}, disable = {},
} }
end end
if not vim.tbl_islist(user_plugins.add) then
user_plugins.add = {}
end
if not vim.tbl_islist(user_plugins.disable) then if not vim.tbl_islist(user_plugins.disable) then
user_plugins.disable = {} user_plugins.disable = {}
end end
@ -200,7 +204,7 @@ return packer.startup(function()
disable = vim.tbl_contains(user_plugins.disable, 'colorizer'), disable = vim.tbl_contains(user_plugins.disable, 'colorizer'),
}) })
if user_plugins.add and not vim.tbl_isempty(user_plugins) then if user_plugins.add and not vim.tbl_isempty(user_plugins.add) then
for _, plugin in pairs(user_plugins.add) do for _, plugin in pairs(user_plugins.add) do
use(plugin) use(plugin)
end end