Vim guides
One question each, answered first. Every example is checked in Vim.
- ciwccddxChange and delete words and linesChange a word with ciw or cw, a line with cc, and delete with d, x and dd. Short answer, worked example and the cases that surprise people.
- iwi"i(apText objectsText objects name a region by its shape: a word, a quoted string, brackets, a paragraph or an HTML element. Use them with c, d and y, from anywhere inside.
- yyyiwpPCopy and paste: yank and putIn Vim, y copies (yanks) and p pastes (puts). Copy a line with yy, a word with yiw, move a line with dd and p, and learn where p puts the text.
- uCtrl-rUndo and redoPress u to undo and Ctrl-r to redo in Vim. What counts as one change, how counts work, and why moving the cursor is never undone.
- /?n*SearchSearch in Vim with / and ?, move between matches with n and N, and find the word under the cursor with *. Also f and t for one line.
- :%sFind and replace with :sFind and replace in Vim with :s/old/new/. Replace on one line or the whole file with :%s, ask before each change with c, and match whole words.
- .cgnqa@aRepeat a change with the dotThe dot command repeats your last change in Vim. Make one change, move, press the dot. How to build changes that repeat well, and when to use a macro.
- vVCtrl-vVisual mode: select textSelect text in Vim with v, whole lines with V, and a column with Ctrl-v. Then delete, copy or change the selection, or type on every line at once.
- w$G3wCounts and motionsVim motions move the cursor by words, lines and characters. Add a count to repeat them, and an operator to act on the text they cover.
- "ayy"0p"_dRegistersVim registers hold copied and deleted text. Copy into a named register with "ayy, keep a copy safe with "0p and "_d, and see where macros live.
How the feedback works
How the site counts your keys and decides when to show a shorter route. Its examples are run through this site's editor when the site is built.