标签:
1 进入自己的vim mkdir ./bundile/vundle
2 在vim同级中执行 git clone https://github.com/gmarik/vundle.git ./bundle/vundle 将一些插件文件 下载到./bundle/vundle中
3 编写自己的vim配置
set nocompatible " be iMproved
filetype off " required!
set rtp+=/Applications/MacVim.app/Contents/Resources/vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
"这是vundle本身的设置
Bundle ‘gmarik/vundle‘
" My Bundles here:
"这里是设置你自己自定义的插件的设置vundle设置,注意:下载的插件git为:https://github.com/godlygeek/tabular.git,则设置为Bundle ‘godlygeek/tabular‘;https://github.com/gmarik/vundle.git设置则为 Bundle ‘gmarik/vundle‘
" original repos on github
Bundle ‘godlygeek/tabular‘
" vim-scripts repos,vim-scripts的访问地址,格式则如下:
Bundle ‘L9‘
Bundle ‘FuzzyFinder‘
" non github repos ,非git的访问地址的,格式如下:
Bundle ‘git://git.wincent.com/command-t.git‘
Bundle "scrooloose/nerdtree"
" ... 添加插件
filetype plugin indent on " required!
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
nmap <F5> :NERDTreeToggle<cr>
"以上为插件的设置 下面为自己的设置
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
call pathogen#infect()
set guioptions-=T " 隐藏工具栏
set guioptions-=m " 隐藏菜单栏
set cursorline " 设置当前行高亮
set autoindent " 设置自动缩进
set number " 显示行数
set ignorecase " 搜索不区分大小写
winpos 0 0 " 设定窗口位置
set lines=40 columns=160 " 设置窗口大小
set transparency=10
colorscheme torte
set diffexpr=MyDiff()
function MyDiff()
let opt = ‘-a --binary ‘
if &diffopt =~ ‘icase‘ | let opt = opt . ‘-i ‘ | endif
if &diffopt =~ ‘iwhite‘ | let opt = opt . ‘-b ‘ | endif
let arg1 = v:fname_in
if arg1 =~ ‘ ‘ | let arg1 = ‘"‘ . arg1 . ‘"‘ | endif
let arg2 = v:fname_new
if arg2 =~ ‘ ‘ | let arg2 = ‘"‘ . arg2 . ‘"‘ | endif
let arg3 = v:fname_out
if arg3 =~ ‘ ‘ | let arg3 = ‘"‘ . arg3 . ‘"‘ | endif
let eq = ‘‘
if $VIMRUNTIME =~ ‘ ‘
if &sh =~ ‘\<cmd‘
let cmd = ‘""‘ . $VIMRUNTIME . ‘\diff"‘
let eq = ‘"‘
else
let cmd = substitute($VIMRUNTIME, ‘ ‘, ‘" ‘, ‘‘) . ‘\diff"‘
endif
else
let cmd = $VIMRUNTIME . ‘\diff‘
endif
silent execute ‘!‘ . cmd . ‘ ‘ . opt . arg1 . ‘ ‘ . arg2 . ‘ > ‘ . arg3 . eq
endfunction
4 打开vim 输入:BundleInstall,就会自动下载插件了
5 若是安装插件 只需要在vimr中加入Bundle "scrooloose/nerdtree" ,引号中味插件名即可;
nerdtree插件使用见 http://xenojoshua.com/2011/04/vim-nerdtree-chinese-manual/
6 注意vimr配置中 set rtp+=/Applications/MacVim.app/Contents/Resources/vim/bundle/vundle/ 后面的地址要正确
7 后期增加新的插件和插件使用更新该笔记;
标签:
原文地址:http://www.cnblogs.com/jackylee92/p/5737993.html