feat: add packer package manager
This commit is contained in:
commit
75c078c8fc
2 changed files with 29 additions and 0 deletions
1
init.lua
Normal file
1
init.lua
Normal file
|
@ -0,0 +1 @@
|
||||||
|
require('plugins')
|
28
lua/plugins.lua
Normal file
28
lua/plugins.lua
Normal 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)
|
||||||
|
|
Loading…
Reference in a new issue