I remember, back in the day, I asked on IRC how to edit a file in Linux. Someone said vi. Little did I know that in chat someone said, the next question is how do I quit. I asked that exact question. Yes chat erupted.
For people who actually don’t know this, yet: Type :x.
This means “eXit, save any changes”
If you want to leave and discard your changes, type :q!
The :q means “Quit”, without any other instructions. This will warn you if you changed anything, adding ! means “force this command”.
How to quit vim.
Just read this book:
I remember, back in the day, I asked on IRC how to edit a file in Linux. Someone said vi. Little did I know that in chat someone said, the next question is how do I quit. I asked that exact question. Yes chat erupted.
I vaguely remember pressing Alt+F4 while trying to close vim in a terminal once. It did switch to me login prompt so I thought it worked.
Either by making it segfault or you don’t.
I got a whole software developer career going out of my attempts to exit vim.
For people who actually don’t know this, yet: Type
:x
.This means “eXit, save any changes”
If you want to leave and discard your changes, type
:q!
The
:q
means “Quit”, without any other instructions. This will warn you if you changed anything, adding!
means “force this command”.