Vi 使用 Vundle 管理插件执行 PluginInstall 出错

Vi 有了 Vundle 这么一个总管(插件管理器),安装插件着实太省事了,再也不需要自己把 *.vim 文件放在各处。只需要做一次

$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

编辑好 ~/.vimrc 文件,装什么每次在这个文件中加上 Plugin 'scrooloose/nerdtree',运行 :PluginInstall 即可。

我第一次体验执行 vim +PluginInstall +qall (和在 Vi 中执行 :PluginInstall 同一效果), 总是得到类似这样的错误

Error detected while processing function vundle#installer#new..<SNR>46_process..vundle#installer#run..vundle#installe
r#install..<SNR>46_sync..<SNR>46_make_sync_command..<SNR>46_get_current_origin_url..<SNR>46_system:
line    1:
E484: Can't open file /var/folders/xz/vqv039517flcxtqzrq_jjy1xqzfzc0/T/v0rQ2fl/1
Error detected while processing function vundle#installer#new..<SNR>46_process..vundle#installer#run..vundle#installe
r#install..<SNR>46_sync:
line    6:
E714: List required
Error detected while processing function vundle#installer#new..<SNR>46_process:
line   13:
E121: Undefined variable: g:vundle_last_status
E15: Invalid expression: 'error' == g:vundle_last_status

我所使用的 Shell 是 fish, 切换到 bash 也是一样的错误,找到答案是 https://github.com/gmarik/Vundle.vim/issues/175

在 ~/.vimrc 文件中加上一句

set shell=/bin/bash

再次执行 vim +PluginInstall +qall 一切正常。

有人在 Win32 中靠 ~/.vimrc 中加如下行

let &shellslash=0

也能解决。

现在进行插件的安装变得很顺畅了,日趋完美了。

需要什么 Vundle 的插件可以到这里来查找 http://vimawesome.com/

本文链接 https://yanbin.blog/vi-vundle-plugininstall-errors/, 来自 隔叶黄莺 Yanbin Blog

[版权声明] Creative Commons License 本文采用 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 进行许可。

Subscribe
Notify of
guest

1 Comment
Inline Feedbacks
View all comments
RAHUL GAUR
RAHUL GAUR
5 years ago

Thank you so much for your help!
I was looking for an analogue of
set shell=/bin/bash for windows.