}

How to exit or quit vim editor

Created:

How to exit or quit vim editor

In most of the cases -> Press ESC key and write ":q!" without quotes.

There is a violent alternative:

  • Press CTRL+Z to pause the process
  • When you pause the process the PID is shown, then use the kill command with the PID to kill violently the vim process.

Explain and more commands

Vim has several modes, like visual, insert, command, etc. When you press the ESC key vim goes to command mode. At the command mode there are several commands to exit:

  • :q to quit
  • :q! to quit without saving
  • :wq to write and quit
  • :wq! to write and quit even if file has only read permission
  • :x to write and quit
  • :qa to quit all