Replies: 1 comment
-
Or maybe add something like this to the readme as an example in the user autocommand section: augroup packer_user_config
autocmd!
autocmd User PackerComplete PackerCompile
autocmd BufWritePost plugins.lua source <afile> | PackerInstall
augroup end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
Typically when installing new plugins, the plugin authors will suggest the installation code which will usually include a
config
function. This needs to get compiled after the install.The packer README suggest an autocommand that run
PackerCompile
after every save. This results in an error when we copy paste any plugins that include aconfig
function.We could run
PackerSync
(which does a compile) but that updates plugins which could cause issues with breaking changes.Ideally I want to be able to run
PackerInstall
andPackerCompile
in one command so that I don't have to worry about the issues listed above. I know that I could write an autocommand based onPackerComplete
, but I think it's too much to ask of casual neovim users that just want to install plugins without getting errors (in the case they use thepacker_user_config
from the readme), or have to remember to run multiple command in the right order in order to get the plugins to install properly.Suggestion
Similar to the
compile_on_sync
options, we could have acompile_on_install
option. So all I have to remember to do is to save my file and runPackerInstall
.It would be
false
by default to maintain current functionality. (But I do think it should be on by default for a smoother user experience).Btw, I'm happy to write an autocommand with
PackerComplete
. This is more for new and intermediate users.Beta Was this translation helpful? Give feedback.
All reactions