diff options
| author | 2022-11-08 13:06:08 -0500 | |
|---|---|---|
| committer | 2022-11-08 13:06:08 -0500 | |
| commit | 946b25db1aa005bf072c3c468cb0641cf2fac45d (patch) | |
| tree | 1afe414f65b2ff978cf3227ee424c21835158672 /dot_config/nvim/lua/ipacker.lua | |
| parent | git: update config (diff) | |
nvim: init bootstrappable config
Diffstat (limited to '')
| -rw-r--r-- | dot_config/nvim/lua/ipacker.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/dot_config/nvim/lua/ipacker.lua b/dot_config/nvim/lua/ipacker.lua new file mode 100644 index 0000000..389e168 --- /dev/null +++ b/dot_config/nvim/lua/ipacker.lua @@ -0,0 +1,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' |
