How to exit vi/vim

It’s really easier than you think — but to be sure, take a deeper look into this article.

Kristjan Hiis
2 min readJul 22, 2020

This piece of software is undoubtedly one of the most tedious one around for any sysadmin or developer alike. People have asked the question that I headlined countless of times on the pages of StackOverflow or broader part of the internet. Today I want to put a serious stop on it!

But first, let’s get to know what people think about vi/vim in general.

So mostly, as you can see, people aren’t too happy about exiting the un-exitable software. If you are a seasoned developer or an admin (hopefully by choice), you might feel like the following:

For all my DevOps friends out there, running their Dockers and Kubernetes’ — that might be a solid solution for you:

On the other hand, it takes only 4–5 keystrokes to actually exit vi(m) — and these are the following.

  1. Press the “esc” button
  2. Write in :q if you want to quit without saving the file
  3. Write in :wq if you want to quit and save the file
  4. … Profit?

To close things out here, I will leave you guys with a Vim Cheat Sheet provided by linuxacademy.com

linuxacademy.com

--

--

Kristjan Hiis

Talking a lot in the realms of observability and engineering in general.