commit 75c078c8fc7dcb8d58acdb6c8a082818c4828e58 Author: Michael Mandl Date: Sun Feb 20 12:10:47 2022 +0100 feat: add packer package manager diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..92cf997 --- /dev/null +++ b/init.lua @@ -0,0 +1 @@ +require('plugins') diff --git a/lua/plugins.lua b/lua/plugins.lua new file mode 100644 index 0000000..b443d70 --- /dev/null +++ b/lua/plugins.lua @@ -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 | 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) +