VIM 命令图解

vgod's vimrc


图转自:http://blog.vgod.tw/

 PDF版下載


Author: Tsung-Hsiang (Sean) Chang vgod@vgod.tw

Fork me on GITHUB https://github.com/vgod/vimrc.

ONE-STEP INSTALL

Use curl (for Mac OS X):

 curl -o - https://raw.githubusercontent.com/vgod/vimrc/master/auto-install.sh | sh

or wget (for most UNIX platforms):

 wget -O - https://raw.githubusercontent.com/vgod/vimrc/master/auto-install.sh | sh

MANUALLY INSTALL

  1. Check out from github

    git clone git://github.com/vgod/vimrc.git ~/.vim
    cd ~/.vim
    git submodule update --init
    
  2. Install ~/.vimrc and ~/.gvimrc

    ./install-vimrc.sh
    
  3. (Optional, if you want Command-T) Compile the Command-T plugin

    cd .vim/bundle/command-t/ruby/command-t
    ruby extconf.rb
    make
    

MANUALLY INSTALL ON WINDOWS

  1. Check out from github

    cd C:\Program Files\Vim   (or your installed path to Vim)
    rmdir /s vimfiles         (This deletes your old vim configurations. If you want to keep it, use move instead of rmdir.)
    git clone git://github.com/vgod/vimrc.git vimfiles
    git submodule update --init
    
  2. Install vimrc. Add the following line at the end of C:\Program Files\Vim\vimrc.

    source $VIM/vimfiles/vimrc
    

INSTALL & UPGRADE PLUGIN BUNDLES

All plugins (except vim-latex) were checked out as git submodules, which can be upgraded withgit pull. For example, to upgrade Command-T

 cd ~/.vim/bundle/command-t
 git pull

To install a new plugin as a git submoudle, type the following commands.

 cd ~/.vim
 git submodule add [GIT-REPOSITORY-URL] bundle/[PLUGIN-NAME]

HOW TO USE

see the "USEFUL SHORTCUTS" section in vimrc to learn my shortcuts.

PLUGINS

  • Pathogen: Pathogen let us install a plugin as a bundle in ~/.vim/bundle seprately.

  • Nerd Tree: A tree explorer plugin for navigating the filesystem.

    Useful commands:
    :Bookmark [name] - bookmark any directory as name
    :NERDTree [name] - open the bookmark [name] in Nerd Tree

  • AutoClose: Inserts matching bracket, paren, brace or quote.

  • vim-multiple-cursors: True Sublime Text style multiple selections for Vim.

  • vim-surround: deal with pairs of surroundings.

  • matchit: extended % matching for HTML, LaTeX, and many other languages.

  • xmledit: XML/HTML tags will be completed automatically.

  • Command-T: open and navigate between files withcmd-t.

  • SuperTab: Do all your insert-mode completion with Tab.

  • snipMate: TextMate-style snippets for Vim

    :help snipMate to see more info.

  • YankRing: Maintains a history of previous yanks, changes and deletes

    :help yankring to see more info.

  • VisIncr: Produce increasing/decreasing columns of numbers, dates, or daynames.

  • Cute Error Marker: showing error and warning icons on line.

    MacVim users need to enable "Use experimental renderer" to seegraphical icons.

  • vim-latex: Latex support.

  • OmniCppComplete: C/C++ omni-completion with ctags database.

  • JavaComplete: Java Omni-completion.

  • EasyMotion: An easy way to jump to a word.

    Useful commands:
    ,,w forward EasyMotion
    ,,b backward EasyMotion

  • TagBar: browsing the tags of source files ordered by classes.

    Useful commands:
    F7 toggles the TagBar

  • Indent Motion: Vim motions to the start and end of the current indentation-delimited block

    Useful commands:
    ,] move to the end of the current indentation-delimited block (very useful in Python and CoffeeScript),[ move to the beginning of the current indentation-delimited block (very useful in Python and CoffeeScript)

  • Zen Coding: expanding abbreviation like zen-coding.

    Useful commands:
    <ctrl-y>, expand zen-coding abbreviation.

  • ack.vim: run ack (a better grep) from vim, and shows the results in a split window.

    :Ack [options] {pattern} [{directory}]

  • Git Gutter: shows a git diff in the 'gutter' (sign column). It shows whether each line has been added, modified, and where lines have been removed.

Language specific supports

  • Latex: Read :help latex-suite.txt
  • Restructured Text: ctrl-u 1~5 inserts Part/Chapter/Section headers
  • HTML, Javascript, CoffeeScript, Python, CSS, C, C++, Java: use TAB to do omni-completion.
  • HTML/XML: End tags are automatically completed after typing a begin tag. (Typing > twice pushes the end tag to a new line.)

Other good references

Vim Visual Cheat Sheet

I've compiled and plotted a Vim Cheat Sheet for beginners. Welcome to download and learn Vim with it.

My Vim Visual Cheat Sheet

These Vim Visual Cheat Sheets are released under Creative Commons Attribution-ShareAlike 3.0 Unported License.

License

This vimrc project is released under Creative Commons Attribution-ShareAlike 3.0 Unported License.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值