1、创建必要的文件和文件夹:
打开终端
创建文件touch ~/.vimrc
创建文件夹mkdir ~/.vim
cd到~/.vim路径下
分别创建bundle colors doc三个文件夹
2、安装MacVim:
下载MacVim,地址:http://www.macupdate.com/app/mac/25988/macvim
把MacVim.app拖拽到Applications
把mvim文件拖拽到~
终端输入sudo mv mvim /usr/local/bin/
3、安装中文帮助文档:
下载中文doc,地址:http://sourceforge.net/projects/vimcdoc/files/vimcdoc/
解压后把doc文件夹里面的所有文件复制到~/.vim/doc/路径下
4、安装Vundle:
官方地址:https://github.com/VundleVim/Vundle.vim
终端输入git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
5、配置.vimrc文件:
5.1、Vundle相关:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()
filetype plugin indent on
5.2、插件相关:
所需要的插件必须写在Plugin 'VundleVim/Vundle.vim'这一行下面,格式如下:
" 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/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
Plugin 'ascenator/L9', {'name': 'newL9'}
5.3、其他功能配置:
写在filetype plugin indent on这一行下面,具体自己查资料
6、终端输入source ~/.vimrc使文件生效
7、Vundle命令:
:h Vundle
:PluginInstall(!)
:PluginUpdate
:PluginSearch(!)
:PluginClean(!)
:PluginList