1. 程式人生 > >vim c/c++配置

vim c/c++配置

git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim  
首先新增 Vundle 管理工具
vim 直接用yum 新增就可以了


然後修改家目錄下面的  .vimrc檔案

下載配色方案

monokai 配色方案 git地址(https://github.com/sickill/vim-monokai) 直接下載對應的monokai.vim 檔案 放到 ~/.vim/colors/ 即可

修改 .vimrc 為以下內容

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'mileszs/ack.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'tyok/nerdtree-ack'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'tpope/vim-rails'
Plugin 'drmingdrmer/xptemplate'
" Begin Snippet
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
Plugin 'altercation/vim-colors-solarized'
" End Snippet
"Plugin 'Valloric/YouCompleteMe'
Bundle 'Valloric/YouCompleteMe'
" Plugin 'majutsushi/tagbar'
call vundle#end()            " required

set nocompatible              " be iMproved, required
set backspace=2 
set encoding=utf-8
set fileencoding=utf-8
set number
set autoindent
set smartindent
set tabstop=4
set autochdir
set shiftwidth=4
syntax enable
colorscheme monokai

let g:tagbar_width = 30
nmap <F2> :NERDTreeToggle<CR>
nmap <F3> :TagbarToggle<CR>
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 3 && !exists("s:std_in") | NERDTree | endif



輸入

:PluginInstall 安裝完對應的外掛即可