- 新建安裝目錄
mkdir -p ~/.vim/bundle/Vundle.vim
- 下載插件管理器Vundle到安裝目錄
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- 使用vim 打開 ~/.vimrc
添加配置信息
set nocompatible " 去除VI一致性,必須要添加
filetype off " 必須要添加
" 設置包括vundle和初始化相關的runtime path
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" 讓vundle管理插件版本,必須
Plugin 'VundleVim/Vundle.vim'
" 在這里添加插件
" 你的所有插件需要在下面這行之前
call vundle#end() " 必須
filetype plugin indent on " 必須 加載vim自帶和插件相應的語法和文件類型相關腳本
進入vim執(zhí)行
:PluginInstall
進行初始化進入vim使用
:BundleInstall 安裝插件
:BundleList 列表插件
:BundleSearch 搜索插件
安裝常用插件
1.安裝ctags
$ yum install ctags
在~/.vimrc中添加
set tags+=./../tags,./../../tags,./../../../tags
- 安裝tagbar
在~/.vimrc中添加
Bundle 'majutsushi/tagbar'
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_width=30
let g:tagbar_left=1
autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx call tagbar#autoopen()
map <F9> :TagbarToggle<CR>
打開vim安裝tagbar
:BundleUpdate