我使用 vundle 作为 vim 的插件管理器。我想使用 ansible 来自动安装 vundle 插件。
但我就是无法自动进行配置:
- name: install vundle plugin
shell: vim +PluginInstall +qall
以上是 vim 的 ansible playbook YML 文件。当 ansible 开始运行这个任务时,它会永远持续下去,永远不会结束,永远不会失败。直到我强迫它停下来CTRL C
。
如果我直接在来宾操作系统中运行该命令,它工作正常,vim 显示并完成安装。
这里有什么问题?
===========================================
编辑:
在阅读Roy Zuo
了答案后,打开 vim 的详细模式,我尝试了以下命令:
vim -E -s -c "source ~/.vimrc" +PluginInstall +qall -V
以下是输出:
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
似乎 vim 在找不到 .vimrc 中指定的插件时停止了。知道如何继续吗?