diff --git a/nvim/.config/nvim/lua/user/packer.lua b/nvim/.config/nvim/lua/user/packer.lua index 3e6481e..c865407 100644 --- a/nvim/.config/nvim/lua/user/packer.lua +++ b/nvim/.config/nvim/lua/user/packer.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() + return require('packer').startup(function(use) -- Packer can manage itself use 'wbthomason/packer.nvim' @@ -53,4 +66,9 @@ return require('packer').startup(function(use) -- other LSP actions use { 'jose-elias-alvarez/null-ls.nvim' } + -- Automatically set up your configuration after cloning packer.nvim + if packer_bootstrap then + require('packer').sync() + end + end)