This article was originally published on The Smart Coder.
How to exit vim?
If you are in the insert mode → press ESC to access command mode and then just type :q! + Enter
But please note that you will exit vim without saving so you should know what you are doing!
Alternatively, you can just enter ZQ on your keyboard and exit vim without saving.