mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2024-12-14 06:00:37 +00:00
47 lines
1.1 KiB
Lua
47 lines
1.1 KiB
Lua
vim.cmd "packadd packer.nvim"
|
|
|
|
local present, packer = pcall(require, "packer")
|
|
|
|
if not present then
|
|
local packer_path = vim.fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
|
|
|
|
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,
|
|
}
|
|
|
|
vim.cmd "packadd packer.nvim"
|
|
present, packer = pcall(require, "packer")
|
|
|
|
if present then
|
|
print "Packer cloned successfully."
|
|
else
|
|
error("Couldn't clone packer !\nPacker path: " .. packer_path .. "\n" .. packer)
|
|
end
|
|
end
|
|
|
|
local user_snapshot = require("core.utils").load_config().snapshot
|
|
|
|
packer.init {
|
|
display = {
|
|
open_fn = function()
|
|
return require("packer.util").float { border = "single" }
|
|
end,
|
|
prompt_border = "single",
|
|
},
|
|
git = {
|
|
clone_timeout = 6000, -- seconds
|
|
},
|
|
auto_clean = true,
|
|
compile_on_sync = true,
|
|
snapshot = user_snapshot,
|
|
}
|
|
|
|
return packer
|