Vim: How to Quit Without Saving

The easiest way to exit the vim editor is by using the :q! command. The steps are outlined in detail below:

  1. Press the ESC key to exit out of insert/append mode into command mode
  2. Then, press the colon key :
  3. You will now be able to enter your command. Type q followed by an exclamation mark: q!
  4. Then, press enter

And that's all. Your document will close without saving any of the changes that you have made.

Related: How to select all in Vim

How To ‘Select All’ in Vim
In this guide, we cover the main methods with which you can select all in the vim/vi editor.

And, that's how we do it, folks! Check out our vim cheatsheet for an extensive list of vim commands to have at your disposal.