Paste and calculate
In Insert mode Ctrl-r pours a jar where you're typing: Ctrl-r" the last yank or delete, and Ctrl-r= the calculator, which types the answer to a sum; Ctrl-n finishes a word from the file.
Monday, 2:00 p.m. Third rehearsal. The demo has a moment where the special of the day goes into two places, and you retype "Birria Bomb" by hand, twice, slowly. Then the projector shows you working out four kitchens times seventy-three orders in your head.
More buttons on the typing keyboard: one pours from a jar, one does sums, and one finishes long words for you.
Warm-up from earlier chapters
Two from earlier chapters, from memory, before the new idea. Two wrong tries show the answer.
Pour the jar
Remember the jar on the kitchen shelf? Every yank and delete fills it. In Insert mode, Ctrl-r followed by the jar's name pours it in where you're typing: Ctrl-r" pours the jar you know. It stays full, so you can pour it again further on. (Track 9 shows the rest of the shelf: there are more jars than one.)
Birria BombPour it twice
Copy the special's name (yi"), then pour it into announce() and into the banner line with Ctrl-r", typing the quotes around it. No retyping the name.
This exercise needs a keyboard. Read on, and play it at your computer.
The calculator jar
One jar on the shelf works out what you write on it. Ctrl-r= opens a small prompt at the bottom of the editor: type a sum like 4*73, press ↵, and 292 is typed where the cursor is. + - * /, brackets and decimals all work.
const lunchOrders = const lunchOrders = 292=: Ctrl-r=, 4*73, ↵, and the answer goes in.Halves
Seven orders split between two riders. You press Ctrl-r=, type 7/2, and ↵. What goes in?
Sums on the projector
Each goal starts in Insert mode where the number goes. Four kitchens times 73 orders; 5 days times 11 hours times 60 minutes; a 15% tip on 48.20. Ctrl-r=, the sum, and before you press ↵, a rough guess: is it nearer 30 or 300? Then ↵, and Esc.
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.
Finish the word
One more button for long names: type the start of a word that's already in the file and press Ctrl-n, and Vim finishes it with the next word that starts that way, looking down the file and round from the top (Ctrl-p looks up instead). A small list shows the other candidates; press it again for the next one, or just keep typing. Like Ctrl-w, the browser keeps Ctrl-N on Windows and Linux, so Alt-N stands in here.
Long names
Each goal starts in Insert mode. Type the first few letters of the name and Ctrl-n. On the second, two names start with deli, and the first one offered is the wrong one: Ctrl-n again moves to the next. Then finish the line and Esc.
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.
Jars, from memory
You're in Insert mode. Press the keys.