blob: 389e16813aaf20650e2e685e6d9ed9e294a5227b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
-- init packer = ipacker
-- returns packer or blackhole
-- sets ipacker global to # depending on bootstrap level
-- ipacker =
-- 0 = no packer present
-- 1 = bootstrapped just now
-- 2 = already present
local fn = vim.fn
local ipath = fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local repo = 'https://github.com/wbthomason/packer.nvim'
ipacker = 0
if #fn.findfile('packer.lua', ipath .. '**') == 0 then
if fn.executable 'git' == 0 then
return require 'blackhole'
end
fn.system {'git', 'clone', '--depth', '1', repo, ipath}
vim.cmd [[packloadall!]]
ipacker = 1
else
ipacker = 2
end
return require 'packer'
|