Learn Practice Daily golf Reference
The Vim Way·Lesson 7 of 7·8 min·0/5 exercises

Happy-hour pricing

The whole of track two against the clock: counted stamps along a search, cgn and . for the misspellings, then combos and the dot formula on the board.

Scene

Friday, 4:55 p.m. Happy hour starts at five. Every happy-hour price drops by 2, two names on the specials are misspelled, and the board needs its 2 for 1 tags.

Five minutes, three files, and a whole week of tools. No retyping.

From memory

Warm-up from earlier chapters

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

Add 5 to the next number on the line.
press the keys…2 keys
1 of 2
Add 5 to the next number on the line.

One change, stamped

One change, stamped: that's the whole track. Ink the stamp once, slide to the next spot with j, ; or n, stamp with .. Order combos so the stamp carries the move. And if you go one too far, every slide and stamp has a partner that goes back.

Before
alPastor: 9,
carnitas: 8,
barbacoa: 10,
2Ctrl-x
alPastor: 7,
carnitas: 8,
barbacoa: 10,
j.
alPastor: 7,
carnitas: 6,
barbacoa: 10,
j.
alPastor: 7,
carnitas: 6,
barbacoa: 8,
Two clicks down on the counter, inked once, then slide and stamp.
Boss round

Stage 1 · Two off everything

4:56. Six happy-hour prices, each one 2 lower: 9 becomes 7, 4 becomes 2. One counted click, stamped on the other five. The prices sit at different columns, so pick a slide that lands on each price.

Stuck? Show a hintOn the word price: *, then 2<C-x>, then n. n. n. n. n. (n wraps round to the top)
Fix the marked spots · 6 left
1export const HAPPY_HOUR = [
1 { id: "al-pastor", price: 9 },
2 { id: "veggie", price: 8 },
3 { id: "carnitas", price: 10 },
4 { id: "birria", price: 11 },
5 { id: "churros", price: 5 },
6 { id: "horchata", price: 4 },
7];
NORMALLoading the editor…0.0s1:1

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

Boss round

Stage 2 · The spellcheck

4:58. guacamloe should be guacamole and horchatta should be horchata, everywhere except the customer review at the bottom, which marketing quotes word for word.

Stuck? Show a hintOn a copy: *, cgn and the right spelling, <Esc>, then . for each copy (n n to let the review go by)
1 of 2Fix the marked spots · 3 left
1export const specials = ["guacamloe dip", "horchatta", "churros"];
1export const combos = {
2 "guacamloe + chips": 6,
3 "churros + horchatta": 5,
4};
5// sold out today: guacamloe, horchatta
6// review: "best guacamloe in town" (quote it exactly)
NORMALLoading the editor…1/20.0s1:1

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

Boss round

Stage 3 · The board

4:59. A // 2 for 1 tag on the end of each of the three board lines, and spaces around every + in total. Your hands are fast now, maybe a little too fast: if a stamp lands somewhere it shouldn't, take it back before you go on.

Stuck? Show a hintA // 2 for 1<Esc> then j. j. · the stray tag: u · in total: f+s + <Esc> then ;.
1 of 3Fix the marked spots · 3 left
1export const BOARD = [
1 "Al Pastor",·// 2 for 1
2 "Garden Veggie",·// 2 for 1
3 "Carnitas",·// 2 for 1
4];
5export const total = base+tax+tip;
NORMALLoading the editor…1/30.0s1:1

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

The first happy-hour orderFinish the exercise above to see it.
From memory

The whole week, from memory

Seven situations from track 2. Press the keys.

Repeat the last change.
scroll here, then press the keys
1 of 7
Repeat the last change.

Extra practice optional

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

Endless

Happy hour never ends

Endless mixed repairs from the whole track: stamps, spacing, misspellings, numbers and endings.

Level 1Fix the marked spots · 3 left
1export const menu = [
1 { id: "al-pastor", name: "Al Pastor", price: 9.5, sipcy: true },
2 { id: "veggie", name: "Garden Veggie", price: 8.25, sipcy: false },
3 { id: "carnitas", name: "Carnitas", price: 10, sipcy: false },
4];
5
6export function findItem(id: string) {
7 const item = menu.find((m) => m.id === id);
8 if (!item) throw new Error("not on null; // ???
9 return item;
10}
NORMALLoading the editor…lv 1 · 0 done0.0s1:1

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