1
0
Fork 0
vdotfiles/nvim/lua/packer_init.lua
2023-01-18 19:18:09 +02:00

23 lines
692 B
Lua

local packer_init = {}
packer_init.init = function(plugins)
local ensure_packer = function()
local install_path = vim.fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.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()
require('packer').startup(plugins)
if packer_bootstrap then
require('packer').sync()
return true
end
return false
end
return packer_init