From b9616aeab06d4007ea874bf5bb201bfe4309881e Mon Sep 17 00:00:00 2001 From: jdhao Date: Wed, 31 Aug 2022 00:01:38 +0800 Subject: [PATCH] update packer conf --- lua/plugins.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 63e8d3c..4010163 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -375,12 +375,13 @@ packer.startup({ -- For fresh install, we need to install plugins. Otherwise, we just need to require `packer_compiled.lua`. if fresh_install then - -- We can command `PackerSync` here, because only after packer.startup, we can know what plugins to install. - -- So plugin install should be done after the startup process. - vim.cmd("PackerSync") + -- We run packer.sync() here, because only after packer.startup, can we know which plugins to install. + -- So plugin installation should be done after the startup process. + packer.sync() else local status, _ = pcall(require, 'packer_compiled') if not status then - vim.notify("Error requiring packer_compiled.lua: run PackerSync to fix!", vim.log.levels.ERROR, { title = 'nvim-config' }) + local msg = "File packer_compiled.lua not found: run PackerSync to fix!" + vim.notify(msg, vim.log.levels.ERROR, { title = 'nvim-config' }) end end