added bootstrapping for packer

This commit is contained in:
Thies Lennart Alff 2023-08-23 16:05:08 +02:00
parent 014bce5573
commit 01d7a642a4
2 changed files with 21 additions and 4 deletions

View file

@ -1,4 +1,16 @@
vim.cmd [[packadd packer.nvim]] -- packer bootstrapping
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) return require('packer').startup(function(use)
-- Packer can manage itself -- Packer can manage itself
@ -25,7 +37,7 @@ return require('packer').startup(function(use)
requires = { requires = {
-- LSP Support -- LSP Support
{ 'neovim/nvim-lspconfig' }, -- Required { 'neovim/nvim-lspconfig' }, -- Required
{ -- Optional { -- Optional
'williamboman/mason.nvim', 'williamboman/mason.nvim',
run = function() run = function()
pcall(vim.cmd, 'MasonUpdate') pcall(vim.cmd, 'MasonUpdate')
@ -34,9 +46,9 @@ return require('packer').startup(function(use)
{ 'williamboman/mason-lspconfig.nvim' }, -- Optional { 'williamboman/mason-lspconfig.nvim' }, -- Optional
-- Autocompletion -- Autocompletion
{ 'hrsh7th/nvim-cmp' }, -- Required { 'hrsh7th/nvim-cmp' }, -- Required
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required { 'hrsh7th/cmp-nvim-lsp' }, -- Required
{ 'L3MON4D3/LuaSnip' }, -- Required { 'L3MON4D3/LuaSnip' }, -- Required
{ 'mhartington/formatter.nvim' }, { 'mhartington/formatter.nvim' },
} }
} }

View file

@ -89,6 +89,11 @@ _G.packer_plugins = {
path = "/home/lennartalff/.local/share/nvim/site/pack/packer/start/formatter.nvim", path = "/home/lennartalff/.local/share/nvim/site/pack/packer/start/formatter.nvim",
url = "https://github.com/mhartington/formatter.nvim" url = "https://github.com/mhartington/formatter.nvim"
}, },
["gitsigns.nvim"] = {
loaded = true,
path = "/home/lennartalff/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
url = "https://github.com/lewis6991/gitsigns.nvim"
},
["lsp-zero.nvim"] = { ["lsp-zero.nvim"] = {
loaded = true, loaded = true,
path = "/home/lennartalff/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", path = "/home/lennartalff/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim",