I'd like to run PlugInstall non-interactively from the command line to provision a new system (using Ansible in this case). If I do vim -c 'PlugInstall' it works, but it is interactive, opening up a terminal window where you can see the progress of the installation. If I try to run it non-interactively I get an error, e.g. "Vim: Warning: Output is not to a terminal", "Vim: Warning: Input is not from a terminal".
NeoBundle provides a script to install ~/.vim/bundle/neobundle.vim/bin/neoinstall non-interactively, could vim-plug offer something similar?
Vim: Warning: Output is not to a terminal
It's a warning not an error. As far as I know, vim will proceed to install the plugins even in that case. Since the installer on Vim 8 is asynchronous, you might want to pass --sync flag as follows
vim +'PlugInstall --sync' +qa
Let me know if it doesn't work as expected.
That worked, thank you!
What does the +qa do btw?
And the + near the beginning? I noticed you used that instead of -c.
:help :qa (quit all)+ is just a shorthand notation of -c, see man vim. Thanks! - I wish I would have looked this up sooner. It's great to be able interact with vim in a shell script.
Thanks to this:
https://github.com/junegunn/vim-plug/issues/225#issuecomment-583541912
This is the only thing working for nvim:
nvim --headless +PlugInstall +qall
Most helpful comment
It's a warning not an error. As far as I know, vim will proceed to install the plugins even in that case. Since the installer on Vim 8 is asynchronous, you might want to pass
--syncflag as followsLet me know if it doesn't work as expected.