Learn Practice Daily golf Reference
Visual mode·Lesson 6 of 7·6 min·0/7 exercisesPro

Prefer operators

A highlight is a strip of a fixed length, so . repeats it by the character; daw means a word, so . repeats a word. Say it with an operator when the thing changes size; highlight shapes.

Scene

Friday, 1:10 p.m. The notes in the report have doubled words, each a different length: the the, orders orders, counted counted. You highlight the first spare the with vaw, delete it, move to the next one and press . to stamp it.

It takes four letters off orders and leaves rs behind.

From memory

Warm-up from earlier chapters

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

Change a block two characters wide and two lines deep to ok.
press the keys…7 keys
1 of 2
Change a block two characters wide and two lines deep to ok.

A strip of a fixed length

A highlight is a strip of this many characters. When you stamp a highlighted change with ., the stamp prints a strip of the same length again, starting at the cursor, whatever is there: four characters, because the was four. An operator is inked with a meaning instead: daw is a word, so . deletes a word, however long.

Before
the the orders orders shipped
vawd
the orders orders shipped
w.
the orders rs shipped
Highlighted: the stamp prints four characters again, and orders loses orde.
Before
the the orders orders shipped
daw
the orders orders shipped
w.
the orders shipped
Said with an operator: the stamp means a word, and orders goes whole.
Check yourself

What does the stamp print?

1a a refunded refunded
NORMAL
Keys pressed: vawdw.

You highlight the spare a with vaw and d it. Then w to the second refunded and .. What is left?

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

Doubled words, any length

Three doubled words of different lengths. daw on the first spare one, then go to the next and stamp it with ..

1 of 3Delete the text marked red
1Orders orders were counted on the day the rider marked them.
1Refunds are counted on the the day they are paid.
2Test orders are never counted counted.
NORMALLoading the editor…1/30.0s1:1

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

Try it

More doubles

Doubled words 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.

From memory

Operator or highlight, from memory

Press the keys.

Delete this word and its space, so the stamp repeats a whole word.
scroll here, then press the keys3 keys
1 of 3
Delete this word and its space, so the stamp repeats a whole word.
Challenge

Say it, then stamp it

Ten fixes across the codebase: doubled words, misspellings and missing semicolons. Operators and the stamp.

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 summary function

1:40. The function behind the summary: two notes at the top were pasted in without their // , three lines of different lengths are missing their semicolons, and refunded, is listed twice in the return. Pick the tool for each: a highlight where the shape is fixed, an operator where the stamp will have to repeat a meaning.

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.