我开始使用 ftplugin。这基本上是有效的,除了捆绑。如果我使用没有特定文件类型的文件启动 gvim,我可以使用我的所有插件(:VundleInstall 列出了 .vimrc 中指定的所有插件)
但是当我打开一个 .cpp 类型的文件并因此使用.vim/after/ftplugin/cpp.vim时,唯一活动的(由 :VundleInstall 显示)插件是在 cpp.vim 文件中指定的插件。
我的错误是什么?
这是我的vimrc:
syntax on
set nocompatible
set t_Co=256
filetype plugin indent on
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" syntax check during writing
Plugin 'scrooloose/syntastic'
....
"swap two panes in an open session
Plugin 'wesQ3/vim-windowswap'
" All of your Plugins must be added before the following line
call vundle#end() " required
....
这是我的 cpp.vim 文件:
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
"plugin to switch easily between header and source
Plugin 'derekwyatt/vim-fswitch'
" All of your Plugins must be added before the following line
call vundle#end() " required
....
我通过将其替换为点(...)缩短了映射和一长串插件