The case for learning a 50-year-old text editor

Chapter 1 — Why Vim?

1.1 The Case for Modal Editing

You spend more time reading, navigating, and restructuring code than typing new code from scratch. Think about your last hour of editing. How much of it was actually inserting new characters? Maybe twenty percent. The rest was scrolling, searching, selecting, deleting, copying, moving, and rearranging.

Most editors give you a full keyboard for that twenty percent — the typing part — and then make you reach for the mouse, or hold down modifier keys, or navigate menus for everything else. Vim flips this. It gives you a full keyboard for the eighty percent.

That's what "modal" means. In normal mode, every key on your keyboard is a command. j moves down. w jumps forward by a word. dw deletes a word. ci" changes the text inside quotes. No mouse. No Ctrl-Shift-Arrow. Just keystrokes.

When you need to type, press i to enter insert mode. Type what you need. Press Esc to come back. Normal mode is your resting state — the mode you spend most of your time in.

iEnter insert mode
EscReturn to normal mode

This feels backwards at first. Every other editor starts in "insert mode" — keys type text. Vim starts in "command mode" — keys do things. The learning curve is real. But once you internalize the grammar, you stop thinking about keystrokes and start thinking in edits: "delete this word," "change inside these quotes," "yank this paragraph." Your hands just execute.

What Is Vim — a 60-second tour
What Is Vim — a 60-second tour

1.2 You Don't Need Vim

The demos in this book use Neovim — a modern, community-driven fork of Vim — because it's clean, fast, and has great defaults. But here's the secret: you don't have to use Neovim. You don't even have to use Vim.

Vim keybindings are available in almost every editor and IDE:

EditorVim Mode
VS CodeVim extension (vscodevim)
JetBrains IDEsIdeaVim plugin
Visual StudioVsVim extension
Sublime TextVintage mode (built-in)
EmacsEvil mode
XcodeXvim2 plugin
Chrome / FirefoxVimium extension

This book teaches the keybindings and the editing language, not any specific editor. diw deletes a word in Vim, Neovim, VS Code with the Vim extension, IntelliJ with IdeaVim, and everywhere else that supports Vim keybindings. The grammar is universal.

Use whatever editor you like. Just turn on Vim mode. Everything in this book will work.


1.3 Vi, Vim, Neovim — A Brief History

The lineage is short and worth knowing:

YearEditorCreatorKey Contribution
1976viBill JoyModal editing on the ADM-3A terminal
1991VimBram MoolenaarVisual mode, undo, scripting, plugins
2014NeovimCommunity forkLua config, async, LSP, modern defaults

Vi was born on the ADM-3A terminal at UC Berkeley. Bill Joy wrote it as the visual interface to the ex line editor. The ADM-3A's keyboard didn't have dedicated arrow keys — instead, the h, j, k, l keys had arrows printed on them. That's why those four keys move the cursor in Vim today.

Bram Moolenaar created Vim (Vi IMproved) in 1991, adding visual mode, multi-level undo, a plugin system, syntax highlighting, and hundreds of features that made vi practical for modern editing. Bram maintained Vim for over 30 years until his passing in 2023.

Neovim forked Vim in 2014 to modernize the codebase: Lua-based configuration, asynchronous processing, built-in LSP support, and better defaults out of the box. For the keybindings covered in this book, Vi, Vim, and Neovim are identical. The differences matter for configuration and plugins, not for daw or ci".


1.4 The Modal Philosophy

Vim has several modes, but two dominate daily editing:

ModePurposeEnter WithLeave With
NormalNavigate, edit, command — your resting stateLaunch vim, or press EscPress a mode-entry key
InsertType text — a brief excursioni, a, o, c, etc.Esc
VisualSelect text, then act on itv, V, Ctrl-VOperator or Esc
Command-lineEx commands (:w, :q, :s):, /, ?Enter or Esc

The key insight: normal mode is called "normal" because it's where you should normally be. Not insert mode. Not visual mode. Normal mode. After every edit — every line you type, every change you make — press Esc and return to normal mode. Make this a reflex.

EscAlways come back to normal mode

In normal mode, every single key on the keyboard has a function. Lowercase letters, uppercase letters, numbers, symbols, Ctrl combinations — they're all commands. That's over 100 commands accessible with a single keystroke, no modifier keys needed. You get this because you have a dedicated mode for commands.

This feels restrictive at first — "I have to press i before I can type?" — but it's actually liberating. In a non-modal editor, the letter d can only ever type the character 'd'. In Vim, d is the delete operator. dw deletes a word. dd deletes a line. di( deletes everything inside parentheses. One key, dozens of uses. That's only possible because of modes.

Normal mode — every key is a command
Normal mode — every key is a command

Quick Reference

KeyAction
iEnter insert mode (keys type text)
EscReturn to normal mode (keys are commands)
h j k lMove left, down, up, right
dwDelete a word (operator + motion)
ci"Change inside quotes (operator + text object)