nvim: re-add automatic plugin install
This commit is contained in:
parent
3bb3075151
commit
769af64a86
|
@ -10,7 +10,7 @@ packer.init()
|
|||
|
||||
packer.use 'https://github.com/wbthomason/packer.nvim'
|
||||
|
||||
-- source file and compile plugins when config file is written
|
||||
-- source file, install and compile plugins when config file is written
|
||||
vim.api.nvim_create_augroup('packer_user_config', { clear = true })
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'BufWritePost' },
|
||||
|
@ -21,13 +21,27 @@ vim.api.nvim_create_autocmd(
|
|||
-- exclude plugins.lua, because that would re-init packer
|
||||
if (not vim.api.nvim_buf_get_name(0):match('plugins.lua$')) then
|
||||
vim.cmd([[
|
||||
echom 'reloading config file…'
|
||||
echom 'reloading config file and installing new plugins…'
|
||||
source <afile>
|
||||
PackerCompile
|
||||
redraw
|
||||
PackerInstall
|
||||
]])
|
||||
end
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'User' },
|
||||
{
|
||||
group = 'packer_user_config',
|
||||
pattern = 'PackerComplete',
|
||||
command = [[echom 'compiling plugins…' | PackerCompile]]
|
||||
}
|
||||
)
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'User' },
|
||||
{
|
||||
group = 'packer_user_config',
|
||||
pattern = 'PackerCompileDone',
|
||||
command = [[echom 'plugins compiled.']]
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user