2022-05-23 03:24:03 -04:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
M.options = {
|
2022-07-22 12:00:00 -04:00
|
|
|
auto_clean = true,
|
|
|
|
compile_on_sync = true,
|
|
|
|
git = { clone_timeout = 6000 },
|
|
|
|
display = {
|
|
|
|
working_sym = "ﲊ",
|
|
|
|
error_sym = "✗ ",
|
|
|
|
done_sym = " ",
|
|
|
|
removed_sym = " ",
|
|
|
|
moved_sym = "",
|
|
|
|
open_fn = function()
|
|
|
|
return require("packer.util").float { border = "single" }
|
|
|
|
end,
|
|
|
|
},
|
2022-05-23 03:24:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
-- merge overrides if there are any
|
2022-05-29 06:37:47 -04:00
|
|
|
M.options = require("core.utils").load_override(M.options, "wbthomason/packer.nvim")
|
2022-05-23 03:24:03 -04:00
|
|
|
|
|
|
|
M.run = function(plugins)
|
2022-07-22 12:00:00 -04:00
|
|
|
local present, packer = pcall(require, "packer")
|
2022-05-23 03:24:03 -04:00
|
|
|
|
2022-07-22 12:00:00 -04:00
|
|
|
if not present then
|
|
|
|
return
|
|
|
|
end
|
2022-05-23 03:24:03 -04:00
|
|
|
|
2022-07-22 12:00:00 -04:00
|
|
|
-- Override with chadrc values
|
|
|
|
plugins = require("core.utils").remove_default_plugins(plugins)
|
|
|
|
plugins = require("core.utils").merge_plugins(plugins)
|
2022-05-23 03:24:03 -04:00
|
|
|
|
2022-07-22 12:00:00 -04:00
|
|
|
packer.init(M.options)
|
2022-05-23 03:24:03 -04:00
|
|
|
|
2022-07-22 12:00:00 -04:00
|
|
|
packer.startup(function(use)
|
|
|
|
for _, v in pairs(plugins) do
|
|
|
|
use(v)
|
|
|
|
end
|
|
|
|
end)
|
2022-05-23 03:24:03 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|