2021-08-12 07:58:03 -04:00
|
|
|
local cmd = vim.cmd
|
|
|
|
|
2021-08-16 03:49:09 -04:00
|
|
|
cmd "packadd packer.nvim"
|
2021-07-18 20:49:27 -04:00
|
|
|
|
2021-07-17 07:14:52 -04:00
|
|
|
local present, packer = pcall(require, "packer")
|
|
|
|
|
|
|
|
if not present then
|
2021-08-16 03:49:09 -04:00
|
|
|
local packer_path = vim.fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
|
2021-07-15 11:46:45 -04:00
|
|
|
|
2021-08-16 03:49:09 -04: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 07:14:52 -04:00
|
|
|
|
2021-08-16 03:49:09 -04:00
|
|
|
cmd "packadd packer.nvim"
|
|
|
|
present, packer = pcall(require, "packer")
|
2021-07-17 07:14:52 -04:00
|
|
|
|
2021-08-16 03:49:09 -04:00
|
|
|
if present then
|
|
|
|
print "Packer cloned successfully."
|
|
|
|
else
|
|
|
|
error("Couldn't clone packer !\nPacker path: " .. packer_path)
|
|
|
|
end
|
2021-07-15 11:46:45 -04:00
|
|
|
end
|
|
|
|
|
2021-08-22 03:49:15 -04:00
|
|
|
packer.init {
|
2021-08-16 03:49:09 -04:00
|
|
|
display = {
|
|
|
|
open_fn = function()
|
|
|
|
return require("packer.util").float { border = "single" }
|
|
|
|
end,
|
|
|
|
prompt_border = "single",
|
|
|
|
},
|
|
|
|
git = {
|
|
|
|
clone_timeout = 600, -- Timeout, in seconds, for git clones
|
|
|
|
},
|
|
|
|
auto_clean = true,
|
|
|
|
compile_on_sync = true,
|
|
|
|
-- auto_reload_compiled = true
|
2021-07-15 11:46:45 -04:00
|
|
|
}
|
2021-08-22 03:49:15 -04:00
|
|
|
|
|
|
|
return packer
|