:wq on a mac code example
Example: how to use vi editor mac
Type "vi file.txt" at command prompt.
Move cursor to where new text will be added.
Type "i" to change to insert mode.
Type new text.
Type ESC to go back to command mode.
type ":wq" and ENTER to write the file and quit.