The most common question most people ask about the vi editor is: How do I exit vi? The joke answer goes: “You don’t. You learn to live with it.” but the serious answer is to press Esc to ensure you’re in command mode first, then type :q!
and hit Enter (or :wq!
to save and quit).
The problem most modern users sit with, is that the vi editor originates from the 1970s and still uses those unique keyboard shortcuts (it did not modernise like the nano editor did in 2024). There is no doubt that the vi editor (or vim if you use the GUI) is very powerful with its long history of support and plugins.
But for most users, like myself, the first thing I do on any new VPS I set up is run sudo apt install nano
. The vi editor is usually already installed by default on most Unix or Linux systems, so you rarely need to ever install it.
But there are many die-hard vi users, and none of those will ever be caught dead using anything else. Certainly if you are looking for more advanced usage out of an editor, it may be well worth learning how to use vi, and you’ll also be safe in the knowledge that nothing will suddenly change in the next few years. It is an editor grounded in stability, extensibility, and consistency.
The linked article is one of the best I’ve seen as a really easy to understand getting started guide with the vi editor. So, if you are curious to just have a look at it, this article will help you understand better how it works (and of course how to exit it).