brew install mercurial
brew install vim
打開高亮渲染
在 ~/.vimrc 中配置
set nonu
syntax on
修復(fù) mac 下 vim 無法使用delete刪除文本的問題
在 ~/.vimrc 中配置
" fix mac vim delete error, so as set backspace=indent,eol,start
set backspace=2
安裝 Vundle
它的使用方法很簡單道偷,安裝一個插件只需要在.vimrc按照規(guī)則中添加 Plugin 的名稱,某些需要添加路徑,之后在 Vim 中使用:PluginInstall既可以自動化安裝。
git 克隆 Vundle 工程到本地
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
修改.vimrc配置 Plugins。在.vimrc文件中添加如下內(nèi)容
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'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" 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
保存后進(jìn)入 vim 運(yùn)行命令
:PluginInstall
vundle 命令
安裝插件
:BundleInstall
更新插件
:BundleUpdate
清除不需要的插件
:BundleClean
列出當(dāng)前的插件
:BundleList
搜索插件
:BundleSearch
注意
插件配置不要在 call vundle#end() 之前抡爹,不然插件無法生效
如果配置錯誤,需要重新配置后,在vim中運(yùn)行 :PluginInstall
安裝 YouCompleteMe
使用 Vundle 安裝 YouCompleteMe
在.vimrc中添加如下內(nèi)容 位置在call vundle#begin()和call vundle#end()之間
Bundle 'Valloric/YouCompleteMe'
在vim中運(yùn)行命令
:BundleInstall
編譯 YouCompleteMe
編譯過程需要CMake
brew install CMake