我的vim插件配置

set nocompatible              " be iMproved, required
filetype off                  " required

" 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'

Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'Xuyuanp/nerdtree-git-plugin'

Plugin 'majutsushi/tagbar'
Plugin 'scrooloose/syntastic'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'jiangmiao/auto-pairs'
Plugin 'Valloric/YouCompleteMe'


Plugin 'tpope/vim-fugitive'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}


" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
" Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'

" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
" Plugin 'user/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

" airline


"设置打开vim的时候默认打开目录树"
let g:nerdtree_tabs_open_on_console_startup=1
" 关闭NERDTree快捷键
map <C-t> :NERDTreeToggle<CR>

""当NERDTree为剩下的唯一窗口时自动关闭
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let g:NERDTreeDirArrowExpandable = ''
let g:NERDTreeDirArrowCollapsible = ''
let NERDTreeAutoCenter=1
" 是否显示隐藏文件
let NERDTreeShowHidden=1
" 设置宽度
let NERDTreeWinSize=23

"let g:NERDTreeIndicatorMapCustom = {
"     "Modified"  : "",
"     "Staged"    : "",
"     "Untracked" : "",
"     "Renamed"   : "",
"     "Unmerged"  : "",
"     "Deleted"   : "",
"     "Dirty"     : "",
"     "Clean"     : "✔︎",
"     "Ignored"   : "'",
"     "Unknown"   : "?"
"     }


"""""""""""""""""""""""""""""""""""""""
let g:airline_powerline_fonts = 1
set t_Co=256
set laststatus=2

" ycm
let g:ycm_python_binary_path='/usr/bin/python'
let g:ycm_confirm_extra_conf=0

let g:ycm_server_python_interpreter='/usr/bin/python'
"let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
let g:ycm_global_ycm_extra_conf='/home/ubuntu/.vim/.ycm_extra_conf.py'

let g:clang_use_library=1


let g:ycm_collect_identifiers_from_tags_files = 1 "tag complete
let g:ycm_seed_identifiers_with_syntax = 1        "yu yi complete

set completeopt-=preview

let g:ycm_complete_in_comments=1                 "comment of complete

syntax on

set number
set cindent
set autoindent
set expandtab

set smarttab
" set mouse=a
set shiftwidth=4
set softtabstop=4
set hls
set bg=dark

编辑文件: vim ~/.vimrc

在shell命令行输入:vim +PluginInstall +qall  安装相关插件

里面代码补全插件:YouCompleteMe比较难装,参考 https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source

原文地址:https://www.cnblogs.com/douzujun/p/10209246.html