dotfiles/.config/nvim/lua/plugins.lua

30 lines
903 B
Lua
Raw Normal View History

2022-08-08 01:41:01 +02:00
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
packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
end
2022-08-08 13:57:38 +02:00
packer = require('packer')
packer.init()
2022-08-08 01:41:01 +02:00
2022-08-08 20:27:58 +02:00
packer.use 'https://github.com/wbthomason/packer.nvim'
2022-08-08 13:57:38 +02:00
-- common dependencies which require setup
2022-08-08 20:27:58 +02:00
packer.use {
2022-08-08 13:57:38 +02:00
'https://github.com/nvim-treesitter/nvim-treesitter',
run = function()
require('nvim-treesitter.install').update({ with_sync = true })
2022-08-08 01:41:01 +02:00
end
2022-08-08 13:57:38 +02:00
}
2022-08-08 01:41:01 +02:00
-- compile and install new plugins when lua files in this dir are written
2022-08-08 01:41:01 +02:00
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd User PackerComplete PackerCompile
autocmd BufWritePost nvim/lua/*.lua source <afile> | PackerInstall
2022-08-08 01:41:01 +02:00
augroup end
]])