diff --git a/lua/plugins.lua b/lua/plugins.lua index a806341..cbe58c2 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,3 +1,16 @@ +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() + vim.cmd([[autocmd BufWritePost plugins.lua source | PackerCompile]]) return require('packer').startup({function() @@ -83,6 +96,10 @@ return require('packer').startup({function() config = function() require'plugins/nvim-tree' end } use 'justinmk/vim-sneak' + + if packer_bootstrap then + require('packer').sync() + end end, config = { display = {