Press the "Esc" key on the keyboard to enter the Vim command mode. Command mode tells Vim to recognize the keystrokes as commands, not text that you want to enter into the document.
Vim, the Unix and Linux command line text editor, can be used to create plain text documents, edit configuration file, or to write scripts and programs. It is an enhanced version of the Vi text editor. Vim uses keystrokes, rather than mouse actions for all editing and navigating. This includes saving changes to a document and exiting the Vim editor. You can choose to save the changes then close the document or close the document without saving any changes.
Type "ZZ" to save the changes made to the document and close it. If you want to save the file with a different file name, or you have not set a name for the file, type "ZZ filename". Replace "filename" with the name you want to give the file.
Type ":q!" to close the document without saving the changes made to it.
Tips & Warnings
- You can also use the vi commands ":wq" and ":x" to save the changes and close the file. The ":x" command will only write to the file if changes have been made.
How to Configure Vim
Vim is an enhanced version of the Vi text editor. Like Vi, It is accessed from the command line and can be...