Source packer automatically if not installed
This commit is contained in:
parent
91f7e6f47f
commit
5519206fdd
1 changed files with 16 additions and 1 deletions
|
|
@ -1,4 +1,15 @@
|
|||
vim.cmd.packadd("packer.nvim")
|
||||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
|
||||
return require("packer").startup(function(use)
|
||||
use "wbthomason/packer.nvim"
|
||||
|
|
@ -117,5 +128,9 @@ return require("packer").startup(function(use)
|
|||
"glacambre/firenvim",
|
||||
run = function() vim.fn["firenvim#install"](0) end
|
||||
}
|
||||
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue