To enter in insert mode
The format for the i is:
Example 1
Example 2
To insert text
The format for the a is:
Example 1
Example 2
Delete code.
More...Example 1
Example 2
To copy text, use (works with command p)
The format for the y is:
Example 1
To paste (work with the text you copy using y).
The format for the p is:
Example 1
Example 2
To create a new line and go to insert mode.
The format for the o is:
Example 1
Example 2
To move to the beginning of the previous word.
The format for the b is:
Move to the end of the file.
The format for the G is:
Example 1
Example 2
Write / and the text you want to search and Enter, press Enter again for the next occurrence and n to redo the search in the foward direction
The format for the / is:
Move in the search
The format for the n is:
Example 1
Example 2
To save your changes, type :w.
The format for the w is:
Example 1
To exit vi, type :q and press Enter.
The format for the q is:
Example 1
To save and quit, use :x and press Enter.
The format for the x is:
To change a word in the whole file write :g/"word you want to be changed"/s\/"word you to change to"/g
The format for the g is:
Example 1