From 769af64a86f6caa5c944413a3d8d50f014f3f426 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 12 Aug 2022 00:06:42 +0200 Subject: [PATCH] nvim: re-add automatic plugin install --- .config/nvim/lua/my/plugins.lua | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.config/nvim/lua/my/plugins.lua b/.config/nvim/lua/my/plugins.lua index 23c589d..e3ae2a5 100644 --- a/.config/nvim/lua/my/plugins.lua +++ b/.config/nvim/lua/my/plugins.lua @@ -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 - 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.']] + } +)