The UNIX vi commands listed on this page which handles navigation, cursor movement, searching, editing, inserting text, using auto-complete, cut copy and paste operations etc in vi are useful for taking advantage of the UNIX vi editor.
vi (Visual Editor) is the default editor that comes with the UNIX operating system.
The UNIX vi editor has two modes of operation:
1.Command mode (commands which cause action to be taken on the file - Press the 'i' character to change to Insert mode).
2.Insert mode (entered text is inserted into the file - Press the <Esc> (Escape) key to go to the command mode).
When using vi, keep in mind that vi is case sensitive. Over time I have learned that the 'Escape' key is king in vi editor.
Start and exit commands
To open a file in the vi editor to start editing, simply type in 'vi <filename>' in the command prompt.
e.g. prompt>vi tmp.txt
To quit vi, type one of the following commands in the command mode and press 'Enter'.
Exit vi, writing out modified file - : x
Exit vi, writing out modified file - :wq
Simply quit vi - :q
Force exit from vi even though changes haven't been saved - :q!
Cursor Navigation in vi editor
By character – h, j, ...