Learn Practice Daily golf Reference
Text objects·Lesson 7 of 8·7 min·0/7 exercisesPro

Objects and dot

Ink the stamp with an object: after ci" or ciw, . changes the next string or word from anywhere inside it, so j. and n. finish the job.

Scene

Wednesday, 10:45 a.m. Marketing has two requests. Every "spicy" tag in menu.json becomes "hot" ("spicy scares people"), and last week's NEW badges come off the website. Neither is hard. Both are the same change, over and over.

In week one you learned never to make the same change twice. The stamp still works, and it works even better on objects.

From memory

Warm-up from earlier chapters

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

To the start of the next sentence.
press the keys…
1 of 2
To the start of the next sentence.

Ink the stamp with an object

. repeats your last change. When that change was ci" and some text, what it remembers is new filling for this string, not these letters at this column. So you can press the stamp anywhere on the next string and it refills that one: you don't have to land on the first letter, only somewhere on the burrito.

Before
<ul class="menu">
<li class="item new">Al Pastor</li>
<li class="item new">Carnitas</li>
<li class="item new">Garden Veggie</li>
<li class="item new">Birria</li>
</ul>
jci"itemEsc
<ul class="menu">
<li class="item">Al Pastor</li>
<li class="item new">Carnitas</li>
<li class="item new">Garden Veggie</li>
<li class="item new">Birria</li>
</ul>
j.
<ul class="menu">
<li class="item">Al Pastor</li>
<li class="item">Carnitas</li>
<li class="item new">Garden Veggie</li>
<li class="item new">Birria</li>
</ul>
j.
<ul class="menu">
<li class="item">Al Pastor</li>
<li class="item">Carnitas</li>
<li class="item">Garden Veggie</li>
<li class="item new">Birria</li>
</ul>
Ink the stamp once with ci", then slide down a line and stamp: j lands somewhere in the next class, and that is enough.
Try it

Badges off

Four item new classes become item. Change the first with ci", then j. for the rest.

1 of 4Delete the text marked red
1<ul class="menu">
1 <li class="item new">Al Pastor</li>
2 <li class="item new">Carnitas</li>
3 <li class="item new">Garden Veggie</li>
4 <li class="item new">Birria</li>
5</ul>
NORMALLoading the editor…1/40.0s1:1

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

Slide, stamp

When the targets line up, j is the slide. When they're scattered, search: n lands on the next one, . stamps it. In JSON, put the quotes in the search: /"spicy" beeps at the tag and not at a description that happens to mention spicy food. One key to move, one to stamp.

Check yourself

A stamp inked from the middle

1["spicy", "spicy"]
NORMAL
Keys pressed: cwhotEscfc.

You change the first spicy with cw from its first letter, typing hot and Esc. Then fc lands on the c of the second one, and you press .. What does the second one become?

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

Misspelled everywhere

One name misspelled all through a file. * to find it, ciw to fix one, then n. for the rest.

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

Stamps, from memory

Press the keys.

Make the last change again, here.
scroll here, then press the keys
1 of 4
Make the last change again, here.
Challenge

Name sweep

Misspelled names repeated through four files. One fix, then 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 hot pass

11:20. Two jobs on menu.json. First every "spicy" tag becomes "hot", and the veggie note that merely mentions spicy food stays as it is. Then every "TODO" note becomes "Ask the kitchen". Each change made once by hand.

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.

Extra practice optional

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

Endless

Stamps, endlessly

Endless names misspelled through a file: fix one, stamp the rest.

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.