vi filenameIf no file name is given, an empty file will be created.
h One space to the left (left arrow) k One line up (up arrow) j One line down (down arrow) l One space to the right (right arrow) ^ Beginning of current line $ End of current line
Other commands can be used to modify text that has been typed. They may only be used in "command mode" (type "Esc" to go from "edit mode" to "command mode"):
a Appends text to the right of the cursor i Appends text to the left of the cursor o Opens a new line below the current line O Opens a new line above the current line
x Deletes character at cursor position dd Deletes current line U Restores current line
:w [filename] Writes changes to [filename] :q Quits vi after above sequence is given :q! Quits without any changes to the file being edited :wq or <shift> ZZ Writes file and quits Note: All but ZZ require carriage returns to execute the function.