V for lines
The highlighter's wide edge: V marks whole lines from anywhere on them, j and } grow it, and d y > J act on every line; p puts them back whole.
Friday, 10:05 a.m. The accountant again: "The test orders are still in, the ones that say TEST. Delete them. And the refunds go at the bottom, where I can find them."
Rows, not words. Whole lines, from wherever your cursor happens to be on them.
Warm-up from earlier chapters
Two from earlier chapters, from memory, before the new idea. Two wrong tries show the answer.
The wide edge
Turn the highlighter on its wide edge: V marks the whole line, whatever column you're in. Vertical motions grow it by whole lines (j, 3j, }, G), and then the verb acts on every line marked: d deletes them, y copies them, > and < indent them, J joins them into one.
id,item,quantity,price,status2201,TEST,1,0.00,test2202,TEST,1,0.00,test2203,TEST,1,0.00,test2204,TEST,1,0.00,test2205,carnitas,1,10.00,delivered2206,al-pastor,4,9.50,delivered2207,birria,3,11.00,delivered2208,veggie,2,8.25,lateid,item,quantity,price,status2205,carnitas,1,10.00,delivered2206,al-pastor,4,9.50,delivered2207,birria,3,11.00,delivered2208,veggie,2,8.25,lateTest orders out
The four TEST rows, from 2201 to 2204. One highlight, one verb.
This exercise needs a keyboard. Read on, and play it at your computer.
Narrow tip or wide edge?
Same rows as this morning, but this time you press V, j, d. What is left?
Lift out, put down
What you cut with V goes in the jar as whole lines, and p puts whole lines back below the cursor's line (P above), wherever on the line the cursor is. So moving rows is three steps: highlight and d, go to the line they belong under, p. To the bottom of the file: G then p.
Refunds last
The two refunded rows go to the bottom of the file: Vj d, G, p.
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.
Indent the body
The report script lost its indentation. Highlight the four lines of the body and >.
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.
Wide edge, from memory
Press the keys.
Rows and blocks
Clusters of junk lines and unindented lines across the codebase. The wide edge, or a counted dd and >> if you prefer.
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.
The export, rows and all
10:40. The real export, where the test rows are 2202 to 2204: the three TEST rows go (2201 and 2205 are real orders, and stay), and the two refunds move to the bottom of the file.
Stuck? Show a hint
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.