How to Exit VIM

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.

Instructions

    • 1

      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.

    • 2

      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.

    • 3

      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.

Related Searches

References

Resources

You May Also Like

  • 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...

  • How to Unlock Keyboards

    PC computers have keyboard options that can be turned on without the user's knowledge. Nothing can be more frustrating than beginning a...

  • How to Replace Exit Sign Lights to Save Energy

    Some exit signs are electric powered and others use no electricity at all. Clearly, the most energy-efficient choice is one that uses...

Related Ads

View Mobile Site