pathogen.vim:vim插件目录自动识别、加载(注意:能用pathogen.vim安装插件,就不要用Vundle。因为Vundle下载插件速度非常慢。)
https://github.com/tpope/vim-pathogen
使用方法:通过git下载插件到~/.vim/bundle后,在vim内,执行以下命令
:call pathogen#helptags()
Vundle:vim插件配制及管理
https://github.com/VundleVim/Vundle.vim
NERDTree:vim目录功能
https://github.com/scrooloose/nerdtree
只提供代码提示功能
https://github.com/Valloric/YouCompleteMe
语法错误检测,并显示错误
https://github.com/vim-syntastic/syntastic
java代码提示、代码补全、代码引用
https://github.com/artur-shaik/vim-javacomplete2
注意:进入网址,根据说明安装后,按照提示添加相关配制(一般是~/.vimrc里面添加配制),才能使插件更好发挥作用。以下是常用配制:
"NERDTree:vim目录功能
autocmd vimenter * NERDTree "自动打开NERDTree目录
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"最后一个NERDTree窗口时,关闭vim
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"NERDTree窗口快捷键
map <C-n> :NERDTreeToggle<CR>
"pathogen.vim:vim插件目录自动识别、加载
execute pathogen#infect()
filetype plugin indent on "开启插件
"Syntastic:语法错误检测,并显示错误
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
"Syntastic:语法错误检测,并显示错误
" Vundle
" 将Vundle加入运行时路径中(RunTime Path:rtp)
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" 使用Vundle管理插件,必须
Plugin 'gmarik/Vundle.vim'
"YouCompleteMe代码提示
Plugin 'Valloric/YouCompleteMe'
Vim 中快速导航文件
Plugin 'git://git.wincent.com/command-t.git'
"javacomplete2:java代码提示、代码补全、代码引用
Plugin 'artur-shaik/vim-javacomplete2'
call vundle#end() " 必须
载入 lang#java
、autocomplete
、checker
、tags
模块即可配置出一个适合 Java 开发的 Vim 环境。