From 2567ebaee43c33311027d103e4663e2564fa62ba Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Mon, 19 Jul 2021 12:42:21 +0530 Subject: [PATCH 1/2] telescope: Fix a bug introduced in 0023233 PackerCompile at the same time conflicts with packer sync because packer always runs in bg --- lua/plugins/telescope.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 0923c8c3..26f97e76 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -77,7 +77,7 @@ if then -- This should only trigger when in need of PackerSync, so better do it print("After completion of PackerSync, restart neovim.") + -- Trigger packer compile on PackerComplete, so it properly waits for PackerSync + vim.cmd 'autocmd User PackerComplete ++once lua require("packer").compile()' require("packer").sync("telescope-fzf-native.nvim", "telescope-media-files.nvim") - -- why compile too ? well, packer is supposed to compile with sync only, but sometimes it doesn't work - vim.cmd("PackerCompile") end From 2e1d53971e5121b37cdd1ff6250aec55ead1370f Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Mon, 19 Jul 2021 15:54:57 +0530 Subject: [PATCH 2/2] install.sh: More automation --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 401ce047..69bce33e 100755 --- a/install.sh +++ b/install.sh @@ -153,7 +153,9 @@ main() { if _NVIM="$(command -v nvim)"; then if _check_nvim_version; then printf "\n%s\n" "=> Neovim will now open." && sleep 1 - "${_NVIM}" +":lua require 'pluginList' vim.cmd('PackerSync')" + "${_NVIM}" +"autocmd User PackerComplete ++once quitall" \ + +":lua require 'pluginList' vim.cmd('PackerSync')" + "${_NVIM}" else printf "Error: Neovim is installed, but version is lower than 0.5.x, install Neovim >= 5.x and then run nvim & do :PackerSync\n." fi