Vim Cheat Sheet
Movement, editing, search & how to actually save and quit.
A free, searchable Vim command guide on one long page. Starts with Normal mode vs. Insert mode — the concept everything else depends on — plus a quick-reference table covering all 4 Vim modes (Normal, Insert, Visual, Command-line). Then covers movement, editing & deleting, search & replace, visual mode, saving & quitting, windows/buffers and power tricks like macros and marks. Every command is explained in plain English with a real worked example. Search “save and quit”, “undo” or “delete line” to jump straight to it. Runs fully in your browser, no sign-up, no API.
About Vim Cheat Sheet
- Every command explained in plain English — no jargon, with a real worked example.
- Starts with Modes — the one concept that unlocks everything else in Vim.
- A quick-reference table for all 4 Vim modes — how to enter each, how to exit, and what it's for.
- Covers movement, editing, search & replace, visual selection, saving/quitting, windows and macros.
- Instant search — type "save and quit", "undo" or "macro" to jump straight to it.
- Answers the internet's most-searched Vim question: how to actually exit it.
- 100% free reference, no sign-up — works the same on a phone, tablet or desktop.
Vim Cheat Sheet features
- Starts with Normal vs. Insert mode — the concept everything else depends on
- A quick-reference table for all 4 Vim modes — how to enter each, exit, and what it's for
- Every command explained in plain English with a real worked example
- Covers movement, editing, search & replace, visual mode, saving/quitting, windows and macros
- Answers the internet's most-searched Vim question: how to exit it
- Instant search across every command and section
- 100% free, no sign-up, no API
Best practices
The habits that make Vim actually fast
Vim rewards a handful of habits far more than memorising every command that exists.
TIPLearn the dot command (.) before almost anything else — it repeats your last change and turns Vim into a repetitive-editing machine.TIPCombine a verb with a motion instead of memorising fixed commands — d (delete) + w (word) = dw, d + $ (end of line) = d$. Once you know a few verbs and motions, you already know dozens of commands.FACTVim is a modal editor because its creator, Bill Joy, built it in the 1970s on terminals where arrow keys often didn't exist — hjkl were simply the keys under his fingers.
If you only remember three things: i to type, Esc to stop typing, :wq to save and quit. Everything else is optional speed.
Frequently asked questions
How do I exit Vim?
Press Esc to make sure you're in Normal mode, then type :wq and press Enter to save and quit, or :q! and Enter to quit WITHOUT saving. Typing i by accident puts you in Insert mode, where letters just type text instead of running commands — press Esc first if nothing seems to work.
How do I save a file in Vim?
Press Esc to reach Normal mode, then type :w and press Enter. To save and quit in one step, type :wq instead.
Why can't I type any text in Vim?
You're in Normal mode, where letter keys are commands, not text. Press i to enter Insert mode — you'll see -- INSERT -- appear at the bottom of the screen — and then you can type normally. Press Esc to leave Insert mode again.
How do I undo a change in Vim?
Press Esc to be in Normal mode, then press u to undo. Press Ctrl+R to redo a change you undid by mistake.
How do I delete a line in Vim?
In Normal mode, press dd to delete the entire current line. It's also copied to Vim's register, so you can paste it elsewhere with p.
How do I copy and paste in Vim?
Vim calls copying "yanking". Press yy in Normal mode to yank (copy) the current line, move the cursor to where you want it, then press p to paste it below (or P to paste above).
How do I find and replace text in Vim?
Type :%s/old-text/new-text/g and press Enter — %s means "on every line", and g means replace every match on each line, not just the first. Add c at the end (…/gc) to be asked to confirm each replacement.
How do I search for text in Vim?
In Normal mode, type / followed by your search term and press Enter. Press n to jump to the next match, or N to jump to the previous one.
How many modes does Vim have?
Four you'll use constantly: Normal (moving and running commands, Vim's default), Insert (typing text, entered with i/a/o/O), Visual (selecting text, entered with v/V/Ctrl+V), and Command-line (one-off commands like :wq, entered by typing a colon). Esc from any of them returns you to Normal mode.
What is the difference between v, V and Ctrl+V in Vim?
v starts character-by-character Visual selection, V (Shift+V) selects whole lines at a time, and Ctrl+V starts Visual Block mode, which selects a rectangular column across multiple lines — useful for editing a column of text at once.
How do I select and delete multiple lines in Vim?
Press Shift+V to start Visual Line mode, move down with j to extend the selection across the lines you want, then press d to delete all of them at once.
What does the dot (.) command do in Vim?
It repeats your last change exactly. Make an edit once — like deleting a word with dw — move the cursor somewhere else, and press . to repeat that exact same edit there. It's one of the biggest speed advantages Vim has over a normal text editor.
How do I record and use a macro in Vim?
Press q followed by a letter (like qa) to start recording into register a, perform the edit once, then press q again to stop. Replay it with @a — or repeat it several times with a number first, like 5@a.
Is this Vim cheat sheet free to use?
Yes — it's 100% free with no sign-up, no login and no limits. Every command, example and the search box work fully in your browser.
Related tools — Guides & Tutorials
- Git & GitHub Guide — Clone, commit, push, branch & merge — every Git command with examples.
- Keyboard Shortcuts Guide (Windows & Mac) — Every shortcut for copy/paste, browsers, Word & Excel — Windows & Mac side by side.
- Regex Cheat Sheet — Syntax Reference — Every regex symbol, quantifier, group & flag explained with copy-ready patterns.
- SQL Cheat Sheet — Syntax & Query Reference — SELECT to window functions, transactions & indexes — with copy-ready queries.
- Python Basics Cheat Sheet — Syntax Reference — Variables, strings, lists, loops & functions — every Python basic with copy-ready code.
- Excel Cheat Sheet — Every essential Excel shortcut & top formula on one page.
- Excel Guide — How Excel works — the fundamentals, explained simply.
- Beginner Excel — Everyday Excel skills — with step-by-step examples.
- Advanced Excel — Lookups, dropdowns, duplicates & PivotTables — with examples.
- Master Excel — Dynamic arrays, Power Query, macros & dashboards.
- Google Sheets Cheat Sheet — Every formula — text, math, lookups, dates & QUERY — with examples.
- VS Code Shortcuts Cheat Sheet — Every keyboard shortcut — editing, multi-cursor, search & debugging.
- Linux / Bash Commands Cheat Sheet — Every terminal command — files, permissions, processes & networking.
- Docker Commands Cheat Sheet — Images, containers, Compose, volumes & cleanup — with examples.