VIM editor is a popular editor and one of the basic operations How to close and exit the vim editor.

It is one of the basic and required steps to quit the vim editor.

This article explains multiple ways to close the editor.

How do I exit the Vim editor?

There are multiple ways to exit the vim editor

Here are the steps to close the editor.

  • First, Go to Normal mode by pressing the ESC key
  • Change to Command mode by typing a colon (:) and : appears bottom of the editor.
  • type one of the commands from one of the below command lists.
  • For example type :q or :quit to exit from the vim editor

Following is a command list with different options to close the vim editor

Parameter Description
:q or :quit exit the current window by saving current changes, if one window exists, exit the editor
:q! or : quit! exit without saving current changes
:wq save the current file and exit, if the file has readonly permissions, failed
:wq! save the current file and exit, even for readonly permissions of a file
:x or :exit save only for modifications and exit
:qa or :quitall exit all windows