diff options
author | Matthew Lemon <y@yulqen.org> | 2023-04-09 09:06:51 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-04-09 09:06:51 +0100 |
commit | 387b1f3a1df078ba3643cd65e827d3ee66dae6bd (patch) | |
tree | 50b814103e480b357726990a1ecefcb330c89090 | |
parent | b0ed665496a280987b2406c9c497446a5f522c29 (diff) |
Adds bootstrapping code to packer.lua
I needed this on NixOS, seemingly.
-rw-r--r-- | nvim/lua/lemon/packer.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/nvim/lua/lemon/packer.lua b/nvim/lua/lemon/packer.lua index 5024f8c..d63cadc 100644 --- a/nvim/lua/lemon/packer.lua +++ b/nvim/lua/lemon/packer.lua @@ -1,7 +1,20 @@ -- This file can be loaded by calling `lua require('plugins')` from your init.vim -- Only required if you have packer configured as `opt` -vim.cmd.packadd('packer.nvim') +--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) -- Packer can manage itself |