added bootstrap packer function

This commit is contained in:
pr0c3550r 2023-01-30 21:50:15 +01:00
parent 6735cf79f8
commit 80c19ac1fa

View file

@ -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)