Learn Practice Daily golf Reference
Insert mode power·Lesson 4 of 4·12 min·0/11 exercisesPro

Replace mode and demo day

Type over instead of in between: r replaces one character, R keeps typing over (⌫ gives the old ones back), r↵ splits a line. Then demo day, live.

Scene

Monday, 4:00 p.m. Last rehearsal of the day. One part of the demo changes prices on the menu board in place: 9.50 becomes 9.75. You delete the old digits and type new ones, and for a moment the line is shorter and everything after it jumps left, then right again.

Some edits are typing over what's there, not in between it. The remote has a door for that, next to i.

From memory

Warm-up from earlier chapters

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

Type the answer to 12*4.
press the keys…7 keys
1 of 2
Type the answer to 12*4.

One letter over

r followed by a character types it over the character under the cursor, and leaves you in Normal mode: one letter replaced, hands back on the remote. A wrong letter in Birrja is r i with the cursor on the j. No Insert mode, nothing to Esc from. (You've met r on a block in the quarter-end report: there it filled every cell.)

Try it

Wrong letters

One wrong letter in each name. Put the cursor on it and r the right one.

1 of 3Change the red text to i
1{ "name": "Birrja", "price": 11.00 },
1{ "name": "Carnitqs", "price": 10.00 },
2{ "name": "Pollo Asadi", "price": 9.00 },
NORMALLoading the editor…1/30.0s1:1

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

Typing over

R is a door into typing, like i, except that what you type goes over the text instead of in between: every key replaces the character under the cursor and moves on, until Esc. Changing 9.50 to 9.75 is R75Esc with the cursor on the 5: the line never changes length. And if you overtype too far, ⌫ gives back the characters that were there.

Before
al-pastor: 9.50 (pork, pineapple)
R75Esc
al-pastor: 9.75 (pork, pineapple)
Typed over, not in between: the price changes and nothing after it moves.
Try it

New prices

Three prices go up: to 9.75, 10.25 and 11.45. Cursor on the first digit after the dot, R, the new digits, Esc.

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

Backspace in Replace mode

1abcd
NORMAL
Keys pressed: Rxyz⌫Esc

On abcd, you press R, type xyz, then ⌫ and Esc. What does the line say?

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

Too far, too long

Two safe experiments. First, you're still in Replace mode and typed three characters too far: give them back. Second, a name gets longer than the room it has, and R would type straight over the price: change or insert instead, so the price survives.

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.

A line break over a space

r↵ types a line break over the character under the cursor. On the space between two statements crammed onto one line, it splits them onto two lines in two keys.

Try it

One statement per line

Two lines with two statements each. On the space after each first ;, 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.

Boss round

Demo day · Live coding

Friday, 10:00 a.m. The investors are in the room and you're on the projector, building the special-of-the-day feature. Each line starts with you just after something went wrong: a word, a character, a whole line. Fix it without leaving Insert mode.

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.

Boss round

Demo day · The special

10:06. The special's name goes on the banner without retyping it, the announcement gets the price variable without spelling it out, and a line you're typing loses its legacy tail without you leaving Insert mode.

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.

Boss round

Demo day · The numbers

10:12. Someone asks how many burritos three lunch rushes of 72 orders make, then what a 10-dollar burrito costs with 8.75% tax. Don't do it in your head, and do guess first.

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.

Boss round

Demo day · The menu board

10:20. The finale: the menu board, live. Al Pastor goes to 9.95, Carnitas to 10.45, Birria to 11.95, and the descriptions after the prices never move. Then the kitchen renames the Birria to Birria de Res, which is longer than the room before its price.

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.

Friday, 10:30 a.m.Finish the exercise above to see it.
From memory

The whole track, from memory

Six situations from this week. The first four are in Insert mode.

Rub out the word you just typed.
scroll here, then press the keys
1 of 6
Rub out the word you just typed.