[nvim] feat: packer boostrapping on first install
This commit is contained in:
parent
4e95af5b7a
commit
98b6a428a7
@ -4,14 +4,19 @@
|
|||||||
-- Description : neovim plugins file
|
-- Description : neovim plugins file
|
||||||
|
|
||||||
|
|
||||||
local execute = vim.api.nvim_command
|
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||||
local fn = vim.fn
|
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||||
|
print("Cloning packer...")
|
||||||
local install_path = fn.stdpath("data").."/site/pack/packer/start/packer.nvim"
|
PACKER_BOOTSTRAP = vim.fn.system({
|
||||||
|
"git",
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
"clone",
|
||||||
fn.system({"git", "clone", "https://github.com/wbthomason/packer.nvim", install_path})
|
"--depth",
|
||||||
execute "packadd packer.nvim"
|
"1",
|
||||||
|
"https://github.com/wbthomason/packer.nvim",
|
||||||
|
install_path,
|
||||||
|
})
|
||||||
|
vim.cmd([[packadd packer.nvim]])
|
||||||
|
print("Done.")
|
||||||
end
|
end
|
||||||
|
|
||||||
return require("packer").startup(function()
|
return require("packer").startup(function()
|
||||||
@ -102,4 +107,10 @@ return require("packer").startup(function()
|
|||||||
"norcalli/nvim-colorizer.lua",
|
"norcalli/nvim-colorizer.lua",
|
||||||
cmd = "ColorizerToggle"
|
cmd = "ColorizerToggle"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-- automatically setup the config after cloning
|
||||||
|
if PACKER_BOOTSTRAP then
|
||||||
|
require("packer").sync()
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user