The best way to exit Vim

Dec 30, 2022 · 1 min read · Post a comment

Trying to wrap up this very challenging year by adding a little fun post. So, this one is for all poor souls trying to exit Vim for first time whether by mistake (the text editor on the server being Vim by default) or not.


  • Vim


Quit the terminal (SSH) session or try to reboot the server, and last, remove Vim …just kidding.

Step 1. Hit the Escape button to get into the “normal” mode.

Step 2. Type :q! to exit without saving changes, :wq to save the file and then quit.


Related post: Set / unset number lines in Vim.

Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.