From a25f4fca70e412a84d335e48366ae63e6cd7a68f Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Tue, 3 Aug 2021 09:38:50 +0530 Subject: [PATCH] Just packer shenanigans --- install.sh | 5 +++-- lua/plugins/telescope.lua | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 31d0264..4f3742e 100755 --- a/install.sh +++ b/install.sh @@ -157,8 +157,9 @@ main() { if _NVIM="$(command -v nvim)"; then if _check_nvim_version; then printf "\n%s\n" "=> Neovim will now open." && sleep 1 - "${_NVIM}" +"autocmd User PackerComplete ++once quitall" \ - +":lua require 'pluginList' vim.cmd('PackerSync')" + "${_NVIM}" +'autocmd User PackerComplete ++once lua print "Waiting for PackerCompile.." vim.cmd "PackerCompile"' \ + +'autocmd User PackerCompileDone ++once quitall' \ + +'lua print "Wait for PackerUpdate and PackerCompile to complete.." require "pluginList" vim.cmd "PackerUpdate"' "${_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." diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 80ba398..d3a9447 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -78,10 +78,11 @@ if end ) then - -- This should only trigger when in need of PackerSync, so better do it - print("After completion of PackerSync, restart neovim.") + -- This should only trigger when in need of PackerSync, so better do it + print("After completion of PackerCompile, restart neovim.") -- Trigger packer compile on PackerComplete, so it properly waits for PackerSync - vim.cmd 'autocmd User PackerComplete ++once lua require("packer").compile()' + vim.cmd 'autocmd User PackerComplete ++once lua print "Waiting for PackerCompile.." require("packer").compile()' + vim.cmd 'autocmd User PackerCompileDone ++once echo "Packer Compile done, restart neovim."' require "pluginList" - require("packer").sync("telescope-fzf-native.nvim", "telescope-media-files.nvim") + require("packer").update("telescope-fzf-native.nvim", "telescope-media-files.nvim") end