Quick Start
已经实现了一个非常基本的自动化脚本,可以输入如下命令进行自动化安装,如果是OSX,需要提前安装brew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
之后运行:
wget -qO- https://raw.github.com/matthewgao/MyVim/master/setup.sh | sh
当所有安装完成,就得到了一个包含如下插件的Vim:
Bundle
FuzzyFinder
L9
tagslist
ctags
NERDtree
NERD-Commenter
Auto-pair
Ctrlp
ctrlp-funky
airline
powerline
translate
vim chinese doc
calendar
molokai colorscheme
项目托管在github上 MyVim
自动安装包含如下过程:
检查系统,yum or apt-get or brew
安装组件
安装MyVim
复制vim到.vim
复制vimrc到.vimrc
安装Bundle
执行BundleInstall
Powerline font
git clone https://github.com/powerline/fonts.gitfonts/install.sh
安装中文Help doc
下载vimdoc包猛击下载,下载的 tar.gz 包括所有翻译过的 vim 文档 (.cnx 文件) 先将其解压缩:
tar zxvf vimcdoc-<version>.tar.gz
然后进入 vimcdoc- 目录并执行
./vimcdoc.sh -i
就可以了。该安装程序会自动识别 Vim 的安装路径,将中文的文档拷贝 到相应的地方。原有的英文文档不受影响。
插件简介
NERDtree
在nerdtree窗口常用操作:
x.......Close the current nodes parent收起当前目录树R.......Recursively refresh the current root刷新根目录树r.......Recursively refresh the current directory刷新当前目录P.......Jump to the root nodep.......Jump to current nodes parentK.......Jump up inside directories at the current tree depth 到同目录第一个节点J.......Jump down inside directories at the current tree depth 最后一个节点o.......Open files, directories and bookmarksi.......Open selected file in a split window上下分屏s.......Open selected file in a new vsplit左右分屏
配置解析
set nocompatible " be iMprovedset shell=/bin/shset tabstop=4set softtabstop=4set shiftwidth=4" FIXMEset expandtabset autoindentset nuset rulercolorscheme molokaiset showcmd" 高亮搜索set hlsearch" 跟随搜索set incsearchset mouse=aset linebreakset mousemodel=popupset autowriteset cmdheight=2" 去掉输入错的提示音set noebset ignorecaseset wildmenu"FIXME 允许backspace和光标跨越行边界set backspace=eol,start,indentset whichwrap+=<,>,h,lset linespace=0set wildmenuset completeopt=preview,menuset completeopt=longest,menu "tab替换成空格if version>=603set helplang=cnset encoding=utf-8endiffiletype onfiletype plugin onfiletype plugin indent on " required!syntax onsyntax enableset rtp+=~/.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 githubBundle 'godlygeek/tabular'" vim-scripts repos,vim-scripts的访问地址,格式则如下:Bundle 'L9'Bundle 'FuzzyFinder'" non github repos ,非git的访问地址的,格式如下:Bundle 'git://git.wincent.com/command-t.git'Bundle 'Auto-Pairs'Bundle 'The-NERD-Commenter'"Bundle 'ctrlp.vim'Plugin 'ctrlp.vim'Plugin 'scrooloose/nerdtree'"" 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 tt :%s/\t/ /g<CR>map <F3> :NERDTreeToggle<CR>imap <F3> <ESC> :NERDTreeToggle<CR>map <silent> <F9> :TlistToggle <CR>let Tlist_Auto_Open=1let Tlist_Exit_OnlyWindow=1let Tlist_Use_Right_Window=1let NERDTreeIgnore=['\.pyc']" crtlp settingset wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.png,*.jpg,*.gif " Mac/Linux
