From 927a57452c3a9c1d7c8632cae1a580f2df9cc908 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sun, 21 Nov 2021 15:45:34 +0800 Subject: [PATCH] update packer-related instructions --- core/plugins.vim | 2 +- docs/README.md | 7 ++++--- docs/nvim_setup_linux.sh | 2 +- lua/plugins.lua | 5 ++++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/plugins.vim b/core/plugins.vim index dc2e6c7..9fbea39 100644 --- a/core/plugins.vim +++ b/core/plugins.vim @@ -493,6 +493,6 @@ function! s:wilder_init() abort \ 'apply_incsearch_fix': 0, \ })) catch /^Vim\%((\a\+)\)\=:E117/ - echohl Error |echomsg "Wilder.nvim missing. Run :PackerInstall to install all plugins."|echohl None + echohl Error |echomsg "Wilder.nvim missing. Run :PackerSync to install all plugins."|echohl None endtry endfunction diff --git a/docs/README.md b/docs/README.md index d67db69..526de9d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -205,9 +205,10 @@ directory, and run the following command to install this configuration: git clone --depth=1 https://github.com/jdhao/nvim-config.git . ``` -After that, when we first open nvim, run command `:PackerInstall` to install -all the plugins. Since I use quite a lot of plugins (more than 60), it may take -some time to install all of them, depending on your network condition. +After that, when we first open nvim, run command `:PackerSync` to install all +the plugins and generate `packer_compiled.lua`. Since I use quite a lot of +plugins (more than 60), it may take some time to install all of them, depending +on your network condition. # Automatic installation diff --git a/docs/nvim_setup_linux.sh b/docs/nvim_setup_linux.sh index 32fd4dd..81990b1 100755 --- a/docs/nvim_setup_linux.sh +++ b/docs/nvim_setup_linux.sh @@ -212,6 +212,6 @@ git clone --depth=1 https://hub.fastgit.org/wbthomason/packer.nvim \ ~/.local/share/nvim/site/pack/packer/start/packer.nvim echo "Installing plugins" -"$NVIM_DIR/bin/nvim" +PackerInstall +qall +"$NVIM_DIR/bin/nvim" +PackerSync +qall echo "Finished installing Nvim and its dependencies!" diff --git a/lua/plugins.lua b/lua/plugins.lua index 30d3254..a406509 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -328,4 +328,7 @@ require("packer").startup({ }, }) -require('packer_compiled') +local status, _ = pcall(require, 'packer_compiled') +if not status then + vim.notify("You should run command PackerCompile") +end