I’ve been using Vim since the first year I started coding. For all the IDEs/editors that I have used, the Vim plugin is always the very first plugin that I install.

I know that Vim can be challenging to work in for people who are not familiar with it. In this article, we’ll cover some fundamental topics like how to exit Vim, rather than quitting Vim.

I will also include the command that you can use to reveal the corresponding help documentation. To do that, first we need to press ESC a few times, and run the command provided, for example, :h vim-modes, and press Enter.

TL;DR – How to Exit Vim

  1. Press ESC once (sometimes twice)
  2. Make sure you are using the English input method
  3. The next step depends on the current status and your expectations:
  • If you didn’t make any changes, type :q and press Enter/return
  • If you made some changes and would like to keep them, type :wq and press Enter/return
  • If you made some changes and would rather discard them, type :q! and press Enter/return

If you want to understand in more detail how this works, let’s dive in.

#vim #developer

How to Exit Vim – Vim Save and Quit Command Tutorial
11.35 GEEK