Practice, Cheat Sheet and Where to Learn More
You have the whole vocabulary now. What turns it into speed is not more reading — it is a fortnight of doing ordinary errands the Vim way instead of the way your hands already know.
This page is three things: drills, graduated so you always have a next one; a cheat sheet you can keep open in a second tab; and a short list of places to learn more, each one still alive and still worth your time.
How to practise
Practise errands, not keys. "Learn yi"" is a bad goal. "The next time an error prints a path in quotes, I will lift it out with yi" instead of dragging with my finger" is a good one, because it fires on its own the next time it happens.
Three rules make it stick.
Pick one drill per day. Not a set — one. The drill you did badly yesterday is the drill for today.
Let yourself be slow. For about a week the Vim way will be slower than the mouse. That is the whole cost, and it is paid once.
Do it in real work. Practising on a scratch file teaches your fingers the keys; practising on the actual output of the actual agent that just failed teaches them when. The second one is the skill.
Drill set 1 — your first ten minutes
Do these in a real terminal with something noisy on screen. Run git log --oneline -20 or ls -la first so there is output to move around in.
- Turn Vim keys on for this terminal: right-click (or long-press with a finger or an Apple Pencil) and choose Vim keys, the last item in the menu.
- Press
Esc. A block appears on the cursor and a NORMAL badge appears in the corner. Nothing was sent to the program — that is the promise. - Move:
kfive times, thenjback down. Thenggto the top of the scrollback andGto the bottom. - Move onto a line with a path or a URL in it. Press
Wa few times, thenba few times, and notice how much furtherWtravels. - Yank a whole line with
yy. It is now on your system clipboard as well — paste it into any other app to prove it. - Find something:
/, type a few letters,Enter, thennfor the next match. - Drop a mark with
ma, go and read somewhere further up, then press backtick thenato come straight back. - Get back to typing: press
i, or tap the NORMAL badge. The badge always works, whatever mode you are in.
You now know: how to leave the keyboard's usual meaning behind, look around, take a copy, and get back.
Drill set 2 — your first week
Now the errands that replace something you currently do with a mouse.
- Lift a path out of an error.
Esc, move onto the line,yi"for a quoted path oryiWfor a bare one. Thenpto send it into the line you are typing, andito carry on. - Fix a typo four words back.
Esc,buntil you are on the word,ciw, type the correction. The cursor stays where the old word was. - Delete a pasted URL you did not want.
Esc, move onto it,diW. Three keys. - Clear the whole command.
Esc,dd— the whole thing in a shell; once per row in an agent's own input box. - Copy what the agent just told you.
Esc, move into the block,yip. A reply is a run of non-blank rows, so one object takes all of it. - Collect three things off one screen.
Esc, then"ayiw, move,"byiw, move,"cyiw— then"ap"bp"cpin whatever order you want them, andito carry on typing. - Get a line out of the bottom two rows so you can actually read it:
Esc, move to it,zz. - Interrupt a running agent:
EscEsc. The first press is the mode key; the second sends a realEscto the program. - Turn on the other half. ⌘⇧V in a code editor (Ctrl⇧V on Windows and Linux). Try
dd, thenuto undo it, then CtrlR to redo.
You now know: the dozen sequences that cover almost everything anyone actually does in terminal output.
Drill set 3 — when you want to be fast
These are the ones that separate "I use Vim keys" from "I am quick".
- Count the keystrokes. Take a long path on screen and reach its end twice: once with
w, once withW. Do it untilWis the reflex for anything with slashes or dots in it. - Character search.
fand a character to land on it,;to go again,,to come back. Then combine:yf.yanks through the next full stop, anddt/deletes up to the next slash — in a terminal that one only reaches the line you are typing. - Repeat instead of retyping.
dawthen.then.removes three words.3xthen.removes three more characters. - Jump the brackets. Land on a bracket and press
%. In a code editor this is how you check a call's arguments without scrolling. - Aim with the screen keys.
HMLto the top, middle and bottom of what is visible;3Hfor three lines in from the top; CtrlU and CtrlD for half a page. - Search for what is already under the cursor.
*thenn. You never type the word. - Case as an operator.
gUiwshouts a word,guiwquiets it,g~eflips to the end of it. - In a code editor, use the command line.
:%s/old/new/gto substitute through the file,:42to jump to a line,:nohto clear a highlight left over from a search. - Record a macro (code editors only):
qthen a letter to start, do the edit once,qto stop, then@and that letter to replay it. - On a phone, spend a session in normal mode only: use the key row's
/0$^?*page for aiming and the delimiter pages foryi"andci'andda(.
You now know: enough that the slow way starts to feel like the long way round.
Cheat sheet
Where is the column to read first, because it is the thing people get wrong.
- Both — works in code editors and in terminals. Most of the sheet.
- Editors — code editors only. A terminal genuinely does not have this, and the last table on this page says why.
- Terminals — either the key exists only in a terminal, or the behaviour described is the terminal's. Never "broken in editors".
The Vim Mode reference is where both halves are written down in full.
Modes
| Keys | What it does | Where |
|---|---|---|
i a | Back to typing — i where the cursor is, a one character further on | Both |
I A | Insert at the start / end of the line | Both |
o O | Open a line below / above. In a terminal there is no line to open, so they simply return you to typing | Both |
v | Visual — select as you move | Both |
V | Visual line | Both |
o in visual | Swap which end of the selection you are extending — the fix for overshooting | Both |
Esc | Back to normal mode | Both |
Esc again | Sends a real Esc to the program — how you interrupt a CLI agent | Terminals |
| Tap the mode badge | Always returns you to typing | Terminals |
Motions
| Keys | What it does | Where |
|---|---|---|
h j k l | Left, down, up, right | Both |
w b e | Words — runs of letters and digits | Both |
W B E | WORDs — runs of non-space. A URL is one W but seven ws | Both |
0 ^ $ | Start of line / first non-blank / end of line | Both |
gg G | Top / bottom — of the file, or of the scrollback | Both |
{ } | Between paragraphs, which in terminal output means blocks | Both |
f F t T + a character | Onto / up to the next or previous one | Both |
; , | Repeat that character search forwards / backwards | Both |
% | Jump to the matching bracket | Both |
H M L | Top / middle / bottom of what is visible; 3H is three lines in from the top | Both |
Moving the view
| Keys | What it does | Where |
|---|---|---|
| CtrlU CtrlD | Half a page up / down | Both |
| CtrlB CtrlF | A full page up / down | Both |
zt zz zb | Put the cursor's line at the top / middle / bottom of the view without moving the cursor. In a terminal this is how you get a line out of the bottom two rows | Both |
Operators and single-key edits
The grammar is (count) (operator) (motion or object). dw, d$, 3dw and ciw all read the same way.
| Keys | What it does | Where |
|---|---|---|
d c y | Delete / change / yank over any motion or object | Both |
> < | Indent / outdent | Editors |
x X | Delete the character under / before the cursor | Both |
r | Replace one character | Both |
s | Substitute — delete the character and start typing | Both |
D C | Delete / change to the end of the line | Both |
dd cc yy | The whole line | Both |
J | Join this line and the next | Editors |
~ | Flip the case of the character under the cursor; 5~ for five | Both |
gUiw guiw g~e | Upper / lower / flip over a motion or object | Both |
gUU guu | Upper / lower the whole line | Both |
u U ~ in visual | Lower / upper / flip the selection | Both |
. | Repeat the last change | Both |
Text objects
i means inner, a means around. Then what kind.
| Keys | What it does | Where |
|---|---|---|
iw aw | Word — aw includes the trailing space | Both |
iW aW | WORD, so a whole URL or path | Both |
ip ap | Paragraph, which in terminal output is a block. ap includes the blank line after it | Both |
i" i' and the backtick pair | Inside quotes, apostrophes or backticks | Both |
i( i[ i{ i< | Inside brackets of each kind. Either half of a pair names it | Both |
ib iB | Vim's aliases — b for parentheses, B for braces | Both |
| Combined | yiw yiW yaw diW ciw viw yip yap vip yi" ci' da[ ci{ vi< | Both |
Search
| Keys | What it does | Where |
|---|---|---|
/ ? | Search forwards / backwards, then Enter | Both |
n N | Next / previous match | Both |
* | Search for the word already under the cursor | Both |
# | The same, backwards | Both |
Yank, paste and registers
This is the block to learn first if you only learn one. Everything here is get that thing off the screen and put it somewhere useful.
| Keys | What it does | Where |
|---|---|---|
y + motion or object | Yank. yw y$ ye yiw yip | Both |
yy 3yy | One line / three lines | Both |
A bare y | Takes the selection you just made — visual, or the search that just landed. A stale highlight from an old drag does not count | Terminals |
| Yanking | Also puts the text on your system clipboard, so it can be pasted anywhere on the device | Terminals |
| A yank that crosses rows | Comes out linewise, whole lines at a time | Terminals |
p | Paste — in a terminal, into what you are typing | Both |
P | Paste before the cursor. In a terminal there is no "before" in a line you do not own, so it does what p does | Both |
3p | Send it three times | Terminals |
p over a selection | Replaces the selection, on the line you are typing | Terminals |
"a before a yank | Stores it there: "ayiw. "ap brings it back | Both |
| Register scope | Editors keep full named registers; in a terminal "a applies to the next command only | — |
Marks and links
Two small things that feel like a luxury until the first time you use them: keeping your place while you go and read further up, and opening a link without aiming at it.
| Keys | What it does | Where |
|---|---|---|
m + a letter | Drop a mark here | Both |
| Backtick + that letter | Return to the exact spot | Both |
| Apostrophe + that letter | Return to the start of that line — terminals only; the code editors have the backtick form instead | Terminals |
gx or Enter | Open a URL: the one under the cursor, or the next one on the line, so landing on the right line is enough | Terminals |
Counts
| Keys | What it does | Where |
|---|---|---|
5j 3W 2yy 3dw | A count multiplies the thing that follows | Both |
3. | Repeats the change three times. Vim's own rule substitutes the count instead; the two agree whenever the original change had no count of its own | Terminals |
Code editors only
| Keys | What it does |
|---|---|
u · CtrlR | Undo · redo |
| CtrlV | Visual block |
q + letter · q · @ + letter | Record a macro · stop · replay it |
:%s/old/new/g | Substitute through the file |
:42 | Jump to line 42 |
:sort · :g :v · :noh · :reg · :set · :map | Sort, global, clear highlight, registers, options, mappings |
:w :q :wq :e | Do not exist. A pane is not a window over a file handle. Files auto-save, and ⌘S forces one |
| Status bar | Shows --INSERT-- / --VISUAL-- and echoes commands as you type them |
Esc in a workflow node | Insert or visual → normal mode; normal → hand focus back to the canvas |
What terminals don't do
One rule covers most of this: read anywhere, change only the line you're typing. Lesson 6 has the detail; this is the glance version.
| Not available | What to do instead |
|---|---|
No u | Your shell's own undo still works — Ctrl_ in bash and zsh, once you are back to typing |
| No editing above the input line | Copy from up there instead: yy, yiw, yip |
| No editing while something is running | Wait for it. Reading and copying never pause |
d and c don't cross a row | y does — it comes out whole lines at a time |
dip does nothing | yip — copying the block is what you wanted |
| No visual block | V for whole lines |
No : command line | There is no file here to address |
. after a change that ended in typing | The replacement text went straight to the program and was never seen here |
Navigation, selection, search and copying never pause for any of this. They work over the whole screen, all the time.
Where to learn more
These are the resources that have been around long enough to trust, and each suits a different kind of learner.
vimtutor— the official half-hour tutorial, and still the best first hour anyone spends on Vim. It ships with Vim itself, so if you have Vim you already have it: typevimtutorin any terminal, including a Circuitry one. It teaches you by making you edit its own text, which is why it sticks.:help— inside real Vim, the built-in manual. Unfashionably thorough and cross-referenced to a fault.:help motion.txtand:help text-objectsare the two chapters worth reading straight through. Best once you already know what you are looking for.- openvim.com — an interactive tutorial that runs in a browser tab, with nothing to install. The gentlest possible start if you would rather not commit to a terminal yet.
- vim-adventures.com — Vim as a puzzle game: you move a character around a map with
h j k l, and the later levels only open to people who have learned the motions. The first levels are free, the rest is paid. Suits anyone who learns better when it is a game than when it is a lesson. - vimhelp.org — the whole Vim manual, rendered for the web and searchable. Use it when you want to look something up on a phone, or link a colleague to a specific paragraph.
- Drew Neil — Practical Vim (Pragmatic Bookshelf) — the book that makes people fast. It is a hundred and some short "tips", each one an errand and the two or three keys that do it, and it is unusually good on the dot command and the repeat-and-reverse habit. Read it after you are comfortable, not before.
- Learn Vim (the Smart Way) — a free, complete online book, well organised and modern. A good middle step between
vimtutorand Practical Vim, and it is easy to read a chapter at a time.
Two notes. Everything those resources teach about motions, operators, text objects, counts and registers applies here exactly — that is the whole point of using Vim's grammar rather than inventing one. What will not apply in Circuitry's terminals is the file-and-buffer half of Vim: windows, splits, :w, :q, undo. Skip those chapters until you are in real Vim.
Try it
A ten-minute setup that leaves you in a position to practise every day.
- Open a terminal and turn Vim keys on from its own menu (right-click, or long-press).
- Set it as the default for new terminals in Settings → Terminal → Vim keys, so you do not have to decide again.
- Turn on the other half with ⌘⇧V from inside a code editor, and check the status bar appears at the bottom.
- Run
vimtutorin that terminal and do Lesson 1. It takes about five minutes. - Keep the Vim Mode reference open in a second tab for a week.
- Choose one drill from Drill set 2 above and use it, badly, three times today.
You now know: where to practise, what to practise next, and where to go when you want more than this course covers.
Well done for getting this far. The curve is real but short: ten minutes to be useful, an afternoon to be fast, a fortnight before you stop noticing you are doing it. And you never have to turn it on everywhere at once — one terminal is a perfectly good place to live for a while.
Related
- Vim Mode — the full reference, both halves
- Terminals
- CLI Coding Agents
- Code Editor
- The Phone Key Row