Vim is a great editor. I have no doubts about that.

 

Yeah sure, it has its own little weird ‘flaws’, but when you think about it, it is all these ‘flaws’ which actually makes it such a productive tool.

 

Right?

 

Though it is these same little weird ‘flaws’ which can be daunting to use at times to get into the flow of the seamless experience since it’s weirdness literally works unlike anything else.

 

I’ve gotten around to learning Vim a few weeks back and it did take me some time to getting the hang of it. Only after many tries did I get anywhere near as productive with Vim.

 

But if you were to ask me this,

“Jake, what if you were given the chance to switch to another editor rather than Vim. Would you go for it?”

 

My answer for you will be that it will hard to leave it once you truly realize how productive and useful Vim can really get. And at that point going back to any other editor seems really unthinkable. That’s my answer.

 

 

Surprisingly, it’s not just both you and I that find Vim to be complicated..

 

Stack Overflow even published a quiet hilarious article on their company blog (which BTW is not something they often do) all leading to one question:

“How to exit the Vim editor?”

 

 

 

Over one million people have visited this question and the best part?

 

Stack Overflow even published a statistical chart on which countries are finding it the hardest using the Vim editor.

 

How to exit Vim editor

 

 

I took a long look and man the only other time I’d ever done that was when the polls showed that Trump became the President, and I gotta say, that’s one depressing chart.

 

Honestly this guide is specially dedicated to all of you who made it into the “How to exit Vim” Hall of Fame.

 

This is for you.

 

 

 

 

How to Exit the Vim editor: 2 Steps

 

Step 1:  Go ahead and Hit the Esc key and you’ll find that Vim goes into command mode.

 

 

Step 2:  Once you’ve done that, then you can type any of the below:

 

  • :q to quit (short for :quit)

 

  • :q! to quit without saving (short for :quit!)

 

  • :wq to write and quit (think write and quit)

 

  • :wq! to write and quit even if file has only read permission (if file does not have write permission: force write)

 

  • : x to write and quit (similar to :wq, but won’t write if there are no changes)

 

  • :qa to quit all (short for :quitall)

 

 

When you press :,  a : will appear at the bottom of your screen.

 

Or you can press Esc ZZ (Esc  Shift+Z  Shift+Z) to write/save if the file was ever changed, then quit.

 

Or if you don’t want to save changes, then you can use ZQ instead.

 

 

Note
Vim has extensive help, so type Esc:helpReturn and you will have all your answers and even a neat tutorial.

 

 

That’s it. 🙂