2021-11-13 17:37:20 +00:00
|
|
|
vim.cmd "packadd packer.nvim"
|
2021-07-19 01:49:27 +01:00
|
|
|
|
2021-07-17 12:14:52 +01:00
|
|
|
local present, packer = pcall(require, "packer")
|
|
|
|
|
|
|
|
if not present then
|
2021-08-16 08:49:09 +01:00
|
|
|
local packer_path = vim.fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
|
2021-07-15 16:46:45 +01:00
|
|
|
|
2021-08-16 08:49:09 +01:00
|
|
|
print "Cloning packer.."
|
|
|
|
-- remove the dir before cloning
|
|
|
|
vim.fn.delete(packer_path, "rf")
|
|
|
|
vim.fn.system {
|
|
|
|
"git",
|
|
|
|
"clone",
|
|
|
|
"https://github.com/wbthomason/packer.nvim",
|
|
|
|
"--depth",
|
|
|
|
"20",
|
|
|
|
packer_path,
|
|
|
|
}
|
2021-07-17 12:14:52 +01:00
|
|
|
|
2021-11-13 17:37:20 +00:00
|
|
|
vim.cmd "packadd packer.nvim"
|
2021-08-16 08:49:09 +01:00
|
|
|
present, packer = pcall(require, "packer")
|
2021-07-17 12:14:52 +01:00
|
|
|
|
2021-08-16 08:49:09 +01:00
|
|
|
if present then
|
|
|
|
print "Packer cloned successfully."
|
|
|
|
else
|
2021-08-23 06:37:44 +01:00
|
|
|
error("Couldn't clone packer !\nPacker path: " .. packer_path .. "\n" .. packer)
|
2021-08-16 08:49:09 +01:00
|
|
|
end
|
2021-07-15 16:46:45 +01:00
|
|
|
end
|
|
|
|
|
2022-05-12 13:56:01 +01:00
|
|
|
local options = {
|
2021-08-16 08:49:09 +01:00
|
|
|
display = {
|
|
|
|
open_fn = function()
|
2022-05-12 13:56:01 +01:00
|
|
|
return require("packer.util").float { border = "double" }
|
2021-08-16 08:49:09 +01:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
git = {
|
2021-11-13 17:37:20 +00:00
|
|
|
clone_timeout = 6000, -- seconds
|
2021-08-16 08:49:09 +01:00
|
|
|
},
|
|
|
|
auto_clean = true,
|
|
|
|
compile_on_sync = true,
|
2022-05-12 13:56:01 +01:00
|
|
|
snapshot = nil,
|
2021-07-15 16:46:45 +01:00
|
|
|
}
|
2021-08-22 08:49:15 +01:00
|
|
|
|
2022-05-12 13:56:01 +01:00
|
|
|
options = nvchad.load_override(options, "wbthomason/packer.nvim")
|
|
|
|
|
|
|
|
packer.init(options)
|
|
|
|
|
2021-08-22 08:49:15 +01:00
|
|
|
return packer
|