You can switch to a different/easier editor,ee
, if you are unfamiliar withvi
syntax. ;D
To save it, you probably want to switch to root (withsu
, or something similar).
:w To write the file.
:q To exit the editor
:q! To exit the editor discarding any changes.
ZZ To save the current file and exit the editor
Assuming the editor is vi, which is not really clear, you can try the following in command mode (if not sure whether you are in command or edit mode, just press ESC first).
Code::w To write the file. :q To exit the editor :q! To exit the editor discarding any changes. ZZ To save the current file and exit the editor