Vim separates typing from giving commands
Vim is a modal editor: the same keys do different things depending on the mode. In Insert mode, keystrokes become text. Pressing Escape leaves that mode and returns to Normal mode, where keys act as editing commands. Escape is a change of mode, not an exit command—which is why pressing it can feel as though nothing happened to someone expecting a conventional “close” button.
Quitting takes a command-line step
From Normal mode, type a colon to open Vim’s command line at the bottom of the screen. Then enter a command and press Return. `:q` means “quit,” but Vim will stop if the file has unsaved changes; that safeguard prevents accidental loss. To keep the edits and leave, use `:wq`, which writes the file and then quits. To discard changes and quit, use `:q!`—the exclamation mark signals that Vim should override its usual warning.
The important distinction is that Escape gets you to the place where you can issue an exit command; it does not issue one itself. Once that sequence becomes familiar, Vim’s apparent trap has a practical logic: leaving is explicit, and unsaved work is not silently thrown away.






