# Vim, Neovim and Emacs

> The editors you drive with keys, inside a terminal. How Vim's modes work, what Neovim changed, how Emacs grows, and how to quit each one.

**Course:** [Code Editors and Package Managers](https://learn.benibix.com/learn/development-tools)  
**Time:** 11 min

**After this lesson you can:**

- Switch between Vim's two main modes
- Save and quit in Vim and in Emacs
- Say what Neovim and Emacs add

## How Vim's modes work, and how to get out

Vim is a free text editor that runs inside a terminal and is driven by keys, not a mouse. It has modes. In normal mode each key is a command, so dd deletes a line. In insert mode keys type letters. In Stack Overflow's 2024 survey, about 22 in 100 developers said they used it.

Vim matters even if you never pick it. It, or the older vi it grew from, is on almost every Linux server. When you log in to a server and a tool opens a file for you, it is often Vim. Knowing five keys gets you out of trouble.

Those keys are these. Press i to start typing. Press Esc to go back to normal mode. Type a colon to reach the command line at the bottom. Then :w saves, :q quits, :wq does both, and :q! quits without saving.

The common slip is typing words while still in normal mode. Each letter runs as a command, and the file changes in strange ways. Press Esc, then u to undo, and press i before you type again.

Neovim is a newer editor built from Vim. The keys and modes work the same, so a Vim user feels at home. Its main change is how you set it up: with a short script in a file called init.lua, rather than Vim's own settings language. It also talks to language tools for hints and errors.

Emacs is an older free editor that you grow with code. Nearly every part of it is written in its own small language, so you can change any of it. People add mail, notes and Git tools to it. Its keys lean on Ctrl: Ctrl+x then Ctrl+s saves, and Ctrl+x then Ctrl+c quits.

Practised users of all three edit very fast, because their hands never leave the keys. The price is the first few weeks, which are slow. Many people use VS Code for daily work and learn just enough Vim for servers.

```vim
$ vim notes.txt
i      start typing (insert mode)
Esc    back to normal mode
:wq    write the file and quit
:q!    quit and throw away changes
```
The five things to know to edit a file in Vim and get out again.

![Two boxes side by side. On the left, normal mode, where each key is a command, such as dd to delete a line. On the right, insert mode, where keys type letters. An arrow marked i goes from normal to insert, and an arrow marked Esc comes back. Below normal mode, a third box shows the command line, reached with a colon, where :wq saves and quits.](https://learn.benibix.com/diagrams/dev5-vim-modes.svg)

### Example: Emma edits a file on a server

Emma logs in to a server to change one setting. The file opens in Vim, and her first word turns into a mess of commands.

She presses Esc and u to undo, then i, types the new value, presses Esc and types :wq. The whole fix takes 2 minutes.

**Words in this lesson:** [Vim](https://learn.benibix.com/term/development/vim), [Neovim](https://learn.benibix.com/term/development/neovim), [Emacs](https://learn.benibix.com/term/development/emacs)

**Question:** How do I quit Vim without saving my changes?

**Answer:** Press Esc, then type :q! and Enter. Esc takes you to normal mode, the colon opens the command line, and :q! quits while throwing changes away. Ctrl+x then Ctrl+c is the Emacs way.

---

Source: https://learn.benibix.com/learn/development-tools/vim-neovim-and-emacs
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
