2022-05-23 07:24:03 +00:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
M.options = {
|
2022-07-22 16:00:00 +00: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 07:24:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
-- merge overrides if there are any
|
2022-05-29 10:37:47 +00:00
|
|
|
M.options = require("core.utils").load_override(M.options, "wbthomason/packer.nvim")
|
2022-05-23 07:24:03 +00:00
|
|
|
|
|
|
|
M.run = function(plugins)
|
2022-07-22 16:00:00 +00:00
|
|
|
local present, packer = pcall(require, "packer")
|
2022-05-23 07:24:03 +00:00
|
|
|
|
2022-07-22 16:00:00 +00:00
|
|
|
if not present then
|
|
|
|
return
|
|
|
|
end
|
2022-05-23 07:24:03 +00:00
|
|
|
|
2022-07-22 16:00:00 +00:00
|
|
|
-- Override with chadrc values
|
|
|
|
plugins = require("core.utils").remove_default_plugins(plugins)
|
|
|
|
plugins = require("core.utils").merge_plugins(plugins)
|
2022-05-23 07:24:03 +00:00
|
|
|
|
2022-07-22 16:00:00 +00:00
|
|
|
packer.init(M.options)
|
2022-05-23 07:24:03 +00:00
|
|
|
|
2022-07-22 16:00:00 +00:00
|
|
|
packer.startup(function(use)
|
|
|
|
for _, v in pairs(plugins) do
|
|
|
|
use(v)
|
|
|
|
end
|
|
|
|
end)
|
2022-05-23 07:24:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|