* # g* g#
Aim the detector at your feet: * and # search for the word under the cursor, whole words only; g* and g# match it inside longer words too.
Monday, 10:10 a.m. Every file that touches a coordinate uses the same few names: lat, lng, zone. You've typed /lat five times this morning, each time with the cursor already sitting on the word lat.
Why tune the detector by hand when you can aim it at the coin under your feet?
Warm-up from earlier chapters
Two from earlier chapters, from memory, before the new idea. Two wrong tries show the answer.
order.order.More like this
You met * in week one, sliding along the packing line; on this beach it aims the detector at your feet. It reads the word under the cursor and searches for more like it, no typing. * sweeps forward, down the file; # sweeps backwards, up it. After either one, n and N carry on with the same word.
Exactly that word, or anything like it
* is strict: it finds lat as a whole word, so zone.lat beeps and latitude doesn't. Sometimes you want the looser setting: g* and g# search for the same letters anywhere, inside longer words too.
lat = zone.lat ?? latitude ?? lat;lat = zone.lat ?? latitude ?? lat;lat: * stops only at the word lat; g* stops inside latitude too.Which ones beep?
The cursor is on lat in line 1. You press *. Where does it land?
The near miss
The cursor is on lat in line 1. You press g*. Where does it stop?
Aim at your feet
Targets are copies of words near the cursor. Move onto one copy, then * or # and n to reach the target.
This exercise needs a keyboard. Read on, and play it at your computer.
Strict or loose
A rider function where lat also hides inside latitude and flatFee. Each goal says which kind of match you want: strict (*) for the word itself, loose (g*) when it may sit inside a longer name. Pick the one that gets there in the fewest presses.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.
More like this, from memory
Press the keys.
More like this
Twelve targets that are copies of words elsewhere in the file. Aim at a copy, sweep, step.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.
Every lat
The first eight lats in zones.ts, top to bottom. Get onto the first, then let * and n walk you through the rest.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis 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.
Echoes
Endless copies to find.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.