Learn Practice Daily golf Reference
Visual mode·Lesson 5 of 7·8 min·0/10 exercisesPro

Ragged ends and block change

In a block, $ reaches the end of every line, so $A appends to ragged rows; c changes the block on every line and r fills it with one character.

Scene

Friday, 12:20 p.m. The old import tool the investors' accountants use wants a semicolon at the end of every row. The rows are every length there is. And while you're in there: the export wrote last year's year on every date, and the phone numbers have to be masked before the file leaves the building.

Three column jobs, and the first one has no column.

From memory

Warm-up from earlier chapters

Two from earlier chapters, from memory, before the new idea. Two wrong tries show the answer.

Add ! after a block one character wide, on this line and the next.
press the keys…5 keys
1 of 2
Add ! after a block one character wide, on this line and the next.

Follow each line to its end

In a block, $ pulls the right edge of the highlight out to the end of every line, however long each one is. Then A writes after that ragged edge: Ctrl-v, down to the last row, $, A, ;, Esc, and every row ends in a semicolon.

Before
2201,al-pastor,1,9.50,delivered
2202,veggie,1,8.25,late
2203,carnitas,3,10.00,delivered
Ctrl-v2j$A;Esc
2201,al-pastor,1,9.50,delivered;
2202,veggie,1,8.25,late;
2203,carnitas,3,10.00,delivered;
Three rows of three lengths: $ stretches the block to each end, and A writes after all of them.
Try it

Semicolons

Five rows, five lengths, one semicolon at the end of each. Ctrl-v, down, $A.

Fix the marked spots · 5 left
12201,al-pastor,1,9.50,delivered;
12202,veggie,1,8.25,late;
22203,carnitas,3,10.00,delivered;
32204,birria,2,11.00,refunded;
42205,pollo,1,9.00,late;
NORMALLoading the editor…0.0s1:1

This exercise needs a keyboard. Read on, and play it at your computer.

Check yourself

Without the dollar

1abc
1a
2abcdef
NORMAL
Keys pressed: Ctrl-vjjA;Esc

A block one column wide sits on the c of the first line and runs down three lines. You press A, type ; and Esc, without $. What happens to the short middle line a?

Pick an answer (or press its number), then watch the engine prove it.

Write over the highlight

c on a block changes it on every line: the highlighted text goes, you type the new text once, and Esc writes it into every line. The year in a fixed-width date is the classic case: a block over 2025 four lines deep, c, 2026, Esc.

Try it

This year

Every date says 2025. A block over the year on all five rows, c, and the right year.

Pro
The rest of this lesson is in Pro

The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.

See Pro

This exercise needs a keyboard. Read on, and play it at your computer.

One character in every cell

r followed by a character fills every cell of the block with it, on every line, no Esc needed. d or x cuts the block out entirely. Masking a column of phone numbers is r* on a block over the digits.

Try it

Mask the phones

The phone numbers line up in one column. A block over all eight characters of each, four rows deep, then r*.

Pro
The rest of this lesson is in Pro

The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.

See Pro

This exercise needs a keyboard. Read on, and play it at your computer.

Check yourself

A column that only looks like one

12201,al-pastor,2025-07-01
12202,veggie,2025-07-01
22203,carnitas,2025-07-02
NORMAL
Keys pressed: Ctrl-v2j3lc2026Esc

Here the date comes after the item name. A block four wide starts on the first 2025 and runs down three rows; you press c, type 2026 and Esc. What does the veggie row become?

Pick an answer (or press its number), then watch the engine prove it.
Try it

Years that don't line up

The payment provider's refunds file has the same wrong year, but its dates come after the item names, so they don't line up. A block is the wrong tool here. Each year is a word of its own, though: change one, and repeat it on the others.

Stuck? Show a hint
Pro
The rest of this lesson is in Pro

The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.

See Pro

This exercise needs a keyboard. Read on, and play it at your computer.

From memory

Ragged and rectangular, from memory

Press the keys.

Add ; to the end of this line and the two below, all different lengths.
scroll here, then press the keys7 keys
1 of 3
Add ; to the end of this line and the two below, all different lengths.
Challenge

Ends and columns

Eight runs of lines missing an ending or a prefix, across the codebase.

Pro
The rest of this lesson is in Pro

The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.

See Pro

This exercise needs a keyboard. Read on, and play it at your computer.

Boss round

The import file

1:00. The file for the old import tool, top to bottom by column: the year on every date becomes 2026, the phone numbers get masked with *, and every row ends in a semicolon. Check the columns line up before you trust a block.

Stuck? Show a hint
Pro
The rest of this lesson is in Pro

The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.

See Pro

This exercise needs a keyboard. Read on, and play it at your computer.

The import toolFinish the exercise above to see it.

Extra practice optional

The chapter is done. These rounds keep going as long as you like: stop whenever it stops being useful.

Endless

Ragged, endlessly

Endless runs of lines missing the same ending.

Pro
The rest of this lesson is in Pro

The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.

See Pro

This exercise needs a keyboard. Read on, and play it at your computer.