I've just tried vim-plug out after using Vundle and NeoBundle in the past.
I'd like to try and automate the install of all my plugins as I'm going to do this in a Dockerfile, in Vundle I would be able to do something like: vim +BundleInstall +qall.
I've attempted vim +PlugInstall +qall but that quits before my plugins have installed. I've also tried creating a shell script similar to the one NeoBundle uses to do this: https://github.com/Shougo/neobundle.vim/blob/master/bin/neoinstall but nothing seems to work.
I also get an error about my colorscheme not being present as it is installed via vim-plug and obviously I can't manage to install everything without manual intervention.
This is all possible, and fairly simple, with NeoBundle and Vundle; any ideas how this can be achieved with vim-plug as I like vim-plug's more minimal approach?
Thanks for any help and this great project.
@rosstimson are you using neovim?? the installer should be synchronous in vim but there are some problem with neovim, see #104. For the error about the colorscheme, I personally use silent! colorscheme solarized so in case (n)vim cannot find the colorscheme it doesn't choke on that.
As @vheon mentioned, it looks like you're running Neovim. We've been planning to make Neovim installer synchronous only during vim_starting for such use case and for that we're waiting for some Neovim issues to be resolved.
(@vheon Since the only workaround for this is to use plain Vim, we could possibly make installer synchronous when :PlugInstall 1, but I still much prefer vim_starting approach)
I also get an error about my colorscheme not being present as it is installed
via vim-plug and obviously I can't manage to install everything without manual
intervention.This is all possible, and fairly simple, with NeoBundle and Vundle
You should run into the same problem regarding colorscheme not present even if you use NeoBundle or Vundle. There's essentially no difference in how these plugin managers update your &runtimepath. I also use silent! colo ....
Thank you both, you are indeed correct, I had recently changed my Dockerfile to use Neovim. I'll keep an eye on issue #104 that you mentioned.
The colorscheme thing was just an aside as it seemed to be a stumbling block with getting an automated install going. I'll use the silent! option. My Dockerfile definitely built fine and installed all vim plugins without stalling on the colorscheme warning when I previously used NeoBundle and standard vim so not sure how.
Anyway, I'm sure my main issue is now down to Neovim (#104), apologies for being such a n00b and thank you both for the pointers.
No problem. Maybe it's a good idea to install both vim and neovim until #104 is fixed and use vim for synchronous installation.
Hi, I am dockerizing vim with the command vim +slient +VimEnter +PlugInstall +qall but always shows the annoying _Press ENTER or type command to continue_. My env is centos 7 with the 7.4 version.
Any ideas?
@longkai Is +slient a typo? Anyway vim +PlugInstall +qall should suffice.
@junegunn Thank you for your reply. I try vim +PlugInstall +qall at first but didn't work so I prepend +slient later.
I find there is an _error_ when executing: _E185: Cannot find color scheme 'solarized'_. It is fine if I comment colorscheme solarized this line.
My .vimrc file(partial) is:
call plug#begin('~/.vim/plugged')
Plug 'https://github.com/altercation/vim-colors-solarized.git'
call plug#end()
colorscheme solarized
How can I fix it? Thanks in advance.
@longkai Well, that's not a valid way to use silent. You see the error message because at the moment solarized is not yet installed. Prepend silent! to the line: silent! colorscheme solarized.
@junegunn thx, it works!
I am also facing the same issue, i need to setup neovim on a machine and then install the plugins non-intercatively.
When i run nvim +PlugInstall +qall. , it opens up the Neovim window showing the progress of Plugin installations.
Is it possible to make this run in background ?
It's worked for me:
vim -E -s -u "path_to_vim_rc/.vimrc" +PlugInstall +qall
@rbhanot4739 this looks better for my Dockerfile build: vim +PlugInstall +qall > /dev/null
@golonzovsky in my case I use nvim if I add > /dev/null it throws code 139 error. Do you know a way around it?
@asolopovas I just figured it out. Looks like nvim has --headless. So for me, nvim --headless +PlugInstall +qall is working while building my Docker containers. Presumably, it has something to do with the lack of ttys
vim -E -s +PlugInstall +qall exit with non-zero(1). Adding +visual worked.
$ vim --version | head -n 1
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 15 2019 16:41:15)
$ vim -E -s +PlugInstall +qall; echo $?
1
$ vim -E -s +PlugInstall +visual +qall; echo $?
0
it worked for me :) vim +PlugInstall +qall >/dev/null 2>&1
Most helpful comment
@longkai Is
+slienta typo? Anywayvim +PlugInstall +qallshould suffice.