vi cheatsheet

  • Indent a block of code: enter visual mode with ‘v’, highlight, and hit ==
  • Jump to the definition of a function in any language, if you’ve run ctags: :ta foo
  • Incremental search for ‘/’ and ‘?’ searches: set incsearch
  • buffer commands :ls , :bn, :enew
  • vim7 only: tab commands: :tabnew, :tabn, control-pageup/pagedown, :tabdo
  • highlight text,hit colon, s/</\&lt;/g
  • s/>/\>/g