我想在不同的组件中分解我的 vimrc。我用 Vundle 管理我的 vim 插件,我希望每个插件都有一个文件,告诉 vundle 管理它并设置如下配置:
vundle.vim:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"Plugin in here:
Plugin 'gmarik/Vundle.vim'
call vundle#end()
filetype plugin indent on
"Plugin Options:
和 syntastic.vim:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"Plugin in here:
Plugin 'scrooloose/syntastic'
call vundle#end()
filetype plugin indent on
"Plugin Options:
" - Python:
let g:syntastic_python_checkers = ['pylint', 'flake8']
let g:syntastic_aggregate_errors = 1
等等。
如果我现在调用这个 vimrc:
source vundle.vim
source syntastic.vim
只有最后一个插件显示在 vundles 插件列表中,但会读取其他配置。我猜,vundle 仅在调用 (:PluginXXX) 时调用 'vundle#begin()'/'vundle#end()' 部分,因此仅返回最后获取的文件的内容。我怎么解决这个问题?我可以使用类似的东西吗
PLUGINS = "Plugin gmarik/vundle"
PLUGINS = $PLUGINS + "Plugin scrooloose/syntastic"
...
并打电话
vundle#begin()
$PLUGINS
vundle#end()
在我的 vimrc 中?如果是这样,vim 变量的语法是什么?