
A quick reference for common vi commands: entering edit mode, undo/restore, deleting lines, and file operations like save and quit.
Entering edit mode
A append at the end of the current line
u undo the last change
U restore the current line
dd delete the current line
Esc exit edit modeFile operations
:x quit; save first if modified
:q quit
:q! force quit
:w write (save)
:w! write, ignoring warnings
:w! file overwrite the given file, ignoring warnings
:wq save and quit