Block insert and append
Ctrl-v highlights a rectangle; I types in front of it and A after it, once, and Esc writes it on every line.
Friday, 11:30 a.m. The report template has rules. Every order id gets a Q3- in front, so the investors can tell this quarter's orders from last quarter's. Every line of the notes is a quote, with > at the start. There are hundreds of rows.
Not characters, not lines: a column, the same few characters at the same place on every line.
Warm-up from earlier chapters
Two from earlier chapters, from memory, before the new idea. Two wrong tries show the answer.
A rectangle of highlight
Ctrl-v drags the highlighter as a rectangle: j and k set how many lines it covers, l and w how wide it is. Then I types in front of the block. While you type, the text appears on the first line only; when you press Esc, Vim copies it to every line of the block.
2201,al-pastor,1,9.50,delivered2202,birria,4,11.00,refunded2203,veggie,3,8.25,delivered2204,pollo,2,9.00,lateQ3-2201,al-pastor,1,9.50,deliveredQ3-2202,birria,4,11.00,refundedQ3-2203,veggie,3,8.25,deliveredQ3-2204,pollo,2,9.00,lateQ3-, and Esc writes it on all four.Q3- on every row
Six rows, each needs Q3- in front of its id. From the first row: Ctrl-v, down to the last, I, type it once, Esc.
This exercise needs a keyboard. Read on, and play it at your computer.
Lost prefixes
Runs of lines that lost the same prefix at the same column. One block, one I.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.
The right edge
A types after the block's right edge instead. The ids are all four digits, so a block four characters wide covers them exactly, and A adds a column right after them: Ctrl-v, down, 3l, A, ,Q3, Esc.
A new column
The old import tool wants a quarter column after the id. Add it to the header by hand, then the rows with a block four characters wide and A.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.
Too short to reach
The block starts on the e of the first line and runs down three lines; the middle line is only two characters long. You press I, type X and Esc. What happens to ab?
Blocks, from memory
Press the keys.
// in front of this line and the two below, in one go.// in front of this line and the two below, in one go.Column sweep
Eight runs of lines with a lost prefix, across the codebase.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.
The template’s rules
12:00. The report as it stands: the three lines of notes become quotes (> in front of each), and the five rows get Q3- in front of their ids.
Stuck? Show a hint
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.
Extra practice optional
The chapter is done. These rounds keep going as long as you like: stop whenever it stops being useful.
Columns, endlessly
Endless runs of lines that lost a prefix.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.