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.

  1. 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.
  2. 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.
  3. Move: k five times, then j back down. Then gg to the top of the scrollback and G to the bottom.
  4. Move onto a line with a path or a URL in it. Press W a few times, then b a few times, and notice how much further W travels.
  5. Yank a whole line with yy. It is now on your system clipboard as well — paste it into any other app to prove it.
  6. Find something: /, type a few letters, Enter, then n for the next match.
  7. Drop a mark with ma, go and read somewhere further up, then press backtick then a to come straight back.
  8. 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.

  1. Lift a path out of an error. Esc, move onto the line, yi" for a quoted path or yiW for a bare one. Then p to send it into the line you are typing, and i to carry on.
  2. Fix a typo four words back. Esc, b until you are on the word, ciw, type the correction. The cursor stays where the old word was.
  3. Delete a pasted URL you did not want. Esc, move onto it, diW. Three keys.
  4. Clear the whole command. Esc, dd — the whole thing in a shell; once per row in an agent's own input box.
  5. 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.
  6. Collect three things off one screen. Esc, then "ayiw, move, "byiw, move, "cyiw — then "ap "bp "cp in whatever order you want them, and i to carry on typing.
  7. Get a line out of the bottom two rows so you can actually read it: Esc, move to it, zz.
  8. Interrupt a running agent: Esc Esc. The first press is the mode key; the second sends a real Esc to the program.
  9. Turn on the other half. V in a code editor (CtrlV on Windows and Linux). Try dd, then u to 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".

  1. Count the keystrokes. Take a long path on screen and reach its end twice: once with w, once with W. Do it until W is the reflex for anything with slashes or dots in it.
  2. Character search. f and a character to land on it, ; to go again, , to come back. Then combine: yf. yanks through the next full stop, and dt/ deletes up to the next slash — in a terminal that one only reaches the line you are typing.
  3. Repeat instead of retyping. daw then . then . removes three words. 3x then . removes three more characters.
  4. Jump the brackets. Land on a bracket and press %. In a code editor this is how you check a call's arguments without scrolling.
  5. Aim with the screen keys. H M L to the top, middle and bottom of what is visible; 3H for three lines in from the top; CtrlU and CtrlD for half a page.
  6. Search for what is already under the cursor. * then n. You never type the word.
  7. Case as an operator. gUiw shouts a word, guiw quiets it, g~e flips to the end of it.
  8. In a code editor, use the command line. :%s/old/new/g to substitute through the file, :42 to jump to a line, :noh to clear a highlight left over from a search.
  9. Record a macro (code editors only): q then a letter to start, do the edit once, q to stop, then @ and that letter to replay it.
  10. On a phone, spend a session in normal mode only: use the key row's / 0 $ ^ ? * page for aiming and the delimiter pages for yi" and ci' and da(.

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

KeysWhat it doesWhere
i aBack to typing — i where the cursor is, a one character further onBoth
I AInsert at the start / end of the lineBoth
o OOpen a line below / above. In a terminal there is no line to open, so they simply return you to typingBoth
vVisual — select as you moveBoth
VVisual lineBoth
o in visualSwap which end of the selection you are extending — the fix for overshootingBoth
EscBack to normal modeBoth
Esc againSends a real Esc to the program — how you interrupt a CLI agentTerminals
Tap the mode badgeAlways returns you to typingTerminals

Motions

KeysWhat it doesWhere
h j k lLeft, down, up, rightBoth
w b eWords — runs of letters and digitsBoth
W B EWORDs — runs of non-space. A URL is one W but seven wsBoth
0 ^ $Start of line / first non-blank / end of lineBoth
gg GTop / bottom — of the file, or of the scrollbackBoth
{ }Between paragraphs, which in terminal output means blocksBoth
f F t T + a characterOnto / up to the next or previous oneBoth
; ,Repeat that character search forwards / backwardsBoth
%Jump to the matching bracketBoth
H M LTop / middle / bottom of what is visible; 3H is three lines in from the topBoth

Moving the view

KeysWhat it doesWhere
CtrlU CtrlDHalf a page up / downBoth
CtrlB CtrlFA full page up / downBoth
zt zz zbPut 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 rowsBoth

Operators and single-key edits

The grammar is (count) (operator) (motion or object). dw, d$, 3dw and ciw all read the same way.

KeysWhat it doesWhere
d c yDelete / change / yank over any motion or objectBoth
> <Indent / outdentEditors
x XDelete the character under / before the cursorBoth
rReplace one characterBoth
sSubstitute — delete the character and start typingBoth
D CDelete / change to the end of the lineBoth
dd cc yyThe whole lineBoth
JJoin this line and the nextEditors
~Flip the case of the character under the cursor; 5~ for fiveBoth
gUiw guiw g~eUpper / lower / flip over a motion or objectBoth
gUU guuUpper / lower the whole lineBoth
u U ~ in visualLower / upper / flip the selectionBoth
.Repeat the last changeBoth

Text objects

i means inner, a means around. Then what kind.

KeysWhat it doesWhere
iw awWord — aw includes the trailing spaceBoth
iW aWWORD, so a whole URL or pathBoth
ip apParagraph, which in terminal output is a block. ap includes the blank line after itBoth
i" i' and the backtick pairInside quotes, apostrophes or backticksBoth
i( i[ i{ i<Inside brackets of each kind. Either half of a pair names itBoth
ib iBVim's aliases — b for parentheses, B for bracesBoth
Combinedyiw yiW yaw diW ciw viw yip yap vip yi" ci' da[ ci{ vi<Both
KeysWhat it doesWhere
/ ?Search forwards / backwards, then EnterBoth
n NNext / previous matchBoth
*Search for the word already under the cursorBoth
#The same, backwardsBoth

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.

KeysWhat it doesWhere
y + motion or objectYank. yw y$ ye yiw yipBoth
yy 3yyOne line / three linesBoth
A bare yTakes the selection you just made — visual, or the search that just landed. A stale highlight from an old drag does not countTerminals
YankingAlso puts the text on your system clipboard, so it can be pasted anywhere on the deviceTerminals
A yank that crosses rowsComes out linewise, whole lines at a timeTerminals
pPaste — in a terminal, into what you are typingBoth
PPaste before the cursor. In a terminal there is no "before" in a line you do not own, so it does what p doesBoth
3pSend it three timesTerminals
p over a selectionReplaces the selection, on the line you are typingTerminals
"a before a yankStores it there: "ayiw. "ap brings it backBoth
Register scopeEditors keep full named registers; in a terminal "a applies to the next command only

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.

KeysWhat it doesWhere
m + a letterDrop a mark hereBoth
Backtick + that letterReturn to the exact spotBoth
Apostrophe + that letterReturn to the start of that line — terminals only; the code editors have the backtick form insteadTerminals
gx or EnterOpen a URL: the one under the cursor, or the next one on the line, so landing on the right line is enoughTerminals

Counts

KeysWhat it doesWhere
5j 3W 2yy 3dwA count multiplies the thing that followsBoth
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 ownTerminals

Code editors only

KeysWhat it does
u · CtrlRUndo · redo
CtrlVVisual block
q + letter · q · @ + letterRecord a macro · stop · replay it
:%s/old/new/gSubstitute through the file
:42Jump to line 42
:sort · :g :v · :noh · :reg · :set · :mapSort, global, clear highlight, registers, options, mappings
:w :q :wq :eDo not exist. A pane is not a window over a file handle. Files auto-save, and S forces one
Status barShows --INSERT-- / --VISUAL-- and echoes commands as you type them
Esc in a workflow nodeInsert 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 availableWhat to do instead
No uYour shell's own undo still works — Ctrl_ in bash and zsh, once you are back to typing
No editing above the input lineCopy from up there instead: yy, yiw, yip
No editing while something is runningWait for it. Reading and copying never pause
d and c don't cross a rowy does — it comes out whole lines at a time
dip does nothingyip — copying the block is what you wanted
No visual blockV for whole lines
No : command lineThere is no file here to address
. after a change that ended in typingThe 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: type vimtutor in 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.txt and :help text-objects are 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 vimtutor and 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.

  1. Open a terminal and turn Vim keys on from its own menu (right-click, or long-press).
  2. Set it as the default for new terminals in Settings → Terminal → Vim keys, so you do not have to decide again.
  3. Turn on the other half with V from inside a code editor, and check the status bar appears at the bottom.
  4. Run vimtutor in that terminal and do Lesson 1. It takes about five minutes.
  5. Keep the Vim Mode reference open in a second tab for a week.
  6. 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.

Lesson 7 — Vim on a Phone · Learn Vim