This is really just for myself to have a reference for using the text editor named VI. Your welcome to use it yourself, perhaps I will make a PDF later to help me cheat more :P until then, on with the non-sense commands:

looking for text

  1. when looking for text and your cursor is on the word you want to search for, use the * character to search for the pattern going forward in your document
  2. setting the "incsearch" option will show the first match or the pattern while you are still typing it
  3. setting the "hlseach" option will highlight all of the matches in the document when searching

moving around

  1. use % to jump from open brace to its matching close brace or from open if statement
  2. at the end of the brace or if statement, use [{ to jump back to its start of the {
  3. use gd to jump from the use of a variable to its local declaration

macros and repeating

  1. to make a macro:
    1. type "qa" to record into register "a"
    2. do all yer commands
    3. type "q" to stop recording
    4. to repeat the macro, enter number of times to repeat, then "@a"
  2. also, the "." will repeat any command you previously execute
comments powered by Disqus