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

Vim Cheat Sheet features

Best practices

The habits that make Vim actually fast

Vim rewards a handful of habits far more than memorising every command that exists.

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