set nocompatible " 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 'gmarik/Vundle.vim'
" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
"添加 tagbar 插件
Plugin 'majutsushi/tagbar'
" 配置 tagbar 插件
let g:tagbar_ctags_bin='ctags' "ctags 程序的路徑
let g:tagbar_width=30 "窗口寬度設(shè)置為 30
let g:tagbar_left=0 "設(shè)置在 vim 左邊顯示
let g:tagbar_map_openfold = "zv" "按 zv 組合鍵打開標(biāo)簽源葫,默認 zc 關(guān)閉標(biāo)簽
"如果是 C 語言的程序的話鸭叙,tagbar 自動開啟
autocmd BufReadPost .cpp,.c,.h,.hpp,.cc,.cxx call tagbar#autoopen()
"我設(shè)置 F2 為打開或者關(guān)閉的快捷鍵,根據(jù)你的習(xí)慣更改
nnoremap <silent> <F2> :TagbarToggle<CR>
"添加 nerdtree 插件
Plugin 'scrooloose/nerdtree'
" 配置 nerdtree 插件,
let NERDTreeWinPos='left' "設(shè)置在 vim 左側(cè)顯示
let NERDTreeWinSize=30 "設(shè)置寬度為 30
let g:NERDTreeDirArrowExpandable = '?'
let g:NERDTreeDirArrowCollapsible = '?'
autocmd vimenter * NERDTree
wincmd w
autocmd VimEnter * wincmd w
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" 我設(shè)置 F3 為打開或者關(guān)閉的快捷鍵卷仑,你可以自定義
map <F3> :NERDTreeToggle<CR>
wincmd w
autocmd VimEnter * wincmd w
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" 我設(shè)置 F3 為打開或者關(guān)閉的快捷鍵孽尽,你可以自定義
map <F3> :NERDTreeToggle<CR>
" 安裝插件
Plugin 'fholgado/minibufexpl.vim'
" 配置插件信息于游,官方文檔提供配置信息
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
let g:miniBufExplMoreThanOne=0
" 注意:這里設(shè)置使用 Ctrl + 上下左右來切換窗口毁葱,請查看官方文檔來自定義
nnoremap <C-Down> <C-W><C-J>
nnoremap <C-Up> <C-W><C-K>
nnoremap <C-Left> <C-W><C-H>
nnoremap <C-Right> <C-W><C-L>
map <T> :MBEbp<CR>
map <R> :MBEbn<CR>
"Enable folding
set foldmethod=indent
set foldlevel=99
"Enable folding with the spacebar
nnoremap <space> za
"set nu