I use vundle as plugin manager for vim. And I want to use ansible to automate vundle plugin installation.
But I just can't get ansible to do provision automatically:
- name: install vundle plugin
shell: vim +PluginInstall +qall
above is the ansible playbook YML file for vim.
When ansible start to run this task, it just goes on forever, it never ends and it never fails. Until I force it to stop by CTRL C
.
If I run that command directly in the guest os, it works fine, vim shows up and finishes installation.
What's the problem here?
==========================================
Edit:
After read Roy Zuo
's answer, and turn on verbose mode of vim, I tried the following command:
vim -E -s -c "source ~/.vimrc" +PluginInstall +qall -V
and below is the output:
continuing in /home/vagrant/.vimrc
Searching for "/usr/share/vim/vimfiles/after/syntax/syncolor.vim"
Searching for "/home/vagrant/.vim/after/syntax/syncolor.vim"
Searching for "/home/vagrant/.vim/bundle/Vundle.vim/syntax/syncolor.vim"
Searching for "/after/syntax/syncolor.vim"
Searching for "colors/solarized.vim" in "/home/vagrant/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/home/vagrant/.vim/after,/home/vagrant/.vim/bundle/Vundle.vim,/after"
Searching for "/home/vagrant/.vim/colors/solarized.vim"
Searching for "/usr/share/vim/vimfiles/colors/solarized.vim"
Searching for "/usr/share/vim/vim74/colors/solarized.vim"
Searching for "/usr/share/vim/vimfiles/after/colors/solarized.vim"
Searching for "/home/vagrant/.vim/after/colors/solarized.vim"
Searching for "/home/vagrant/.vim/bundle/Vundle.vim/colors/solarized.vim"
Searching for "/after/colors/solarized.vim"
not found in 'runtimepath': "colors/solarized.vim"
line 188:
E185: Cannot find color scheme 'solarized'
finished sourcing /home/vagrant/.vimrc
continuing in command line
It seems vim stopped when it can't find the plugin specified in .vimrc. Any idea how to continue?