feat: add packer package manager

main
mandlm 2022-02-20 12:10:47 +01:00
commit 75c078c8fc
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7
2 changed files with 29 additions and 0 deletions

1
init.lua Normal file
View File

@ -0,0 +1 @@
require('plugins')

28
lua/plugins.lua Normal file
View File

@ -0,0 +1,28 @@
local fn = vim.fn
local cmd = vim.cmd
-- Boostrap Packer
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
local packer_bootstrap
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({'git', 'clone','https://github.com/wbthomason/packer.nvim', install_path})
end
-- Rerun PackerSync everytime plugins.lua is updated
cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerSync
augroup end
]])
-- Initialize pluggins
return require('packer').startup(function(use)
-- Let Packer manage itself
use('wbthomason/packer.nvim')
if packer_bootstrap then
require('packer').sync()
end
end)