{"schemaVersion":1,"contentVersion":"3.4.0","id":"intermediate.13","languages":{"javascript":{"id":"intermediate.13","title":"Edit a rectangle","moduleName":"Repeat, select and compose","tips":"","concept":"<p class=\"lead\">Edit a column of text on several lines at once. The change shows up when you press Esc.</p><p><strong>Before this lesson:</strong> Visual selection and insertion.</p><p>Ctrl-v selects a rectangle. I types at its left edge and A at its right edge, and the text appears on every line when you press Esc. Press $ before A to add text at the real end of each line, even when the lines are different lengths. gv selects the same block again, so you can add to the start and then the end. If your browser takes over Ctrl-v, use Keyboard check.</p><h3>Example</h3><p>Select the first column of three notes with Ctrl-v then 2j. Press I, type a bullet and a space, then press Esc to add them to all three lines.</p><p>Use Start over to try again.</p>","teaches":["visual:<C-v>"],"introduces":["<C-v>","I","A","$","count"],"constraints":[],"drills":[{"task":"The four lines run together as one paragraph. Make each of them a list item, <code>&lt;li&gt;</code> at the start and <code>&lt;/li&gt;</code> at the end.","hint":"Select the lines with Ctrl-v and type at the left edge with I. Then gv selects the same block again, and $A adds to the end of each line.","mode":"jsx","start":"// Shown under the price on every product page.\nexport function DeliveryInfo() {\n  return (\n    <ul className=\"delivery-info\">\n      Free delivery on orders over 50 euros\n      Sent within two working days\n      Free returns for 30 days\n      Pay later with Klarna\n    </ul>\n  );\n}","startCursor":{"line":3,"ch":4},"paths":[{"keys":["j","w","<C-v>","3","j","I","<li>","<Esc>","g","v","$","A","</li>","<Esc>"],"tier":"idiomatic","technique":"visual:<C-v>","core":["visual:<C-v>","door-I","door-A"],"note":"A block insert types on every line at once. With $ in the block, A adds at the real end of each line, whatever its length."}],"target":"// Shown under the price on every product page.\nexport function DeliveryInfo() {\n  return (\n    <ul className=\"delivery-info\">\n      <li>Free delivery on orders over 50 euros</li>\n      <li>Sent within two working days</li>\n      <li>Free returns for 30 days</li>\n      <li>Pay later with Klarna</li>\n    </ul>\n  );\n}","language":"javascript","evidence":"guided","canonicalKey":"intermediate.13#0","canonicalFingerprint":"5tb1gl"}]},"python":{"id":"intermediate.13","title":"Edit a rectangle","moduleName":"Repeat, select and compose","tips":"","concept":"<p class=\"lead\">Edit a column of text on several lines at once. The change shows up when you press Esc.</p><p><strong>Before this lesson:</strong> Visual selection and insertion.</p><p>Ctrl-v selects a rectangle. I types at its left edge and A at its right edge, and the text appears on every line when you press Esc. Press $ before A to add text at the real end of each line, even when the lines are different lengths. gv selects the same block again, so you can add to the start and then the end. If your browser takes over Ctrl-v, use Keyboard check.</p><h3>Example</h3><p>Select the first column of three notes with Ctrl-v then 2j. Press I, type a bullet and a space, then press Esc to add them to all three lines.</p><p>Use Start over to try again.</p>","teaches":["visual:<C-v>"],"introduces":["<C-v>","I","A","$","count"],"constraints":[],"drills":[{"task":"Piped into the Django shell, bare expressions print nothing. Wrap the four lines about the order's money in <code>print(…)</code>.","hint":"Select the lines with Ctrl-v and type at the left edge with I. Then gv selects the same block again, and $A adds to the end of each line.","mode":"python","start":"\"\"\"Check one order's totals by hand: python manage.py shell < scripts/check_totals.py\"\"\"\nfrom shop.orders.models import Order\n\norder = Order.objects.get(number=\"1042\")\norder.subtotal\norder.discount\norder.shipping\norder.total\norder.refresh_from_db()","startCursor":{"line":3,"ch":0},"paths":[{"keys":["j","<C-v>","3","j","I","print(","<Esc>","g","v","$","A",")","<Esc>"],"tier":"idiomatic","technique":"visual:<C-v>","core":["visual:<C-v>","door-I","door-A"],"note":"A block insert types on every line at once. With $ in the block, A adds at the real end of each line, whatever its length."}],"target":"\"\"\"Check one order's totals by hand: python manage.py shell < scripts/check_totals.py\"\"\"\nfrom shop.orders.models import Order\n\norder = Order.objects.get(number=\"1042\")\nprint(order.subtotal)\nprint(order.discount)\nprint(order.shipping)\nprint(order.total)\norder.refresh_from_db()","language":"python","evidence":"guided","canonicalKey":"intermediate.13#0","canonicalFingerprint":"5tb1gl"}]},"text":{"id":"intermediate.13","title":"Edit a rectangle","moduleName":"Repeat, select and compose","tips":"","concept":"<p class=\"lead\">Edit a column of text on several lines at once. The change shows up when you press Esc.</p><p><strong>Before this lesson:</strong> Visual selection and insertion.</p><p>Ctrl-v selects a rectangle. I types at its left edge and A at its right edge, and the text appears on every line when you press Esc. Press $ before A to add text at the real end of each line, even when the lines are different lengths. gv selects the same block again, so you can add to the start and then the end. If your browser takes over Ctrl-v, use Keyboard check.</p><h3>Example</h3><p>Select the first column of three notes with Ctrl-v then 2j. Press I, type a bullet and a space, then press Esc to add them to all three lines.</p><p>Use Start over to try again.</p>","teaches":["visual:<C-v>"],"introduces":["<C-v>","I","A","$","count"],"constraints":[],"drills":[{"task":"The last four rows don't show as a table. Give them the outer pipes the header has, <code>| </code> at the start and <code> |</code> at the end.","hint":"Select the lines with Ctrl-v and type at the left edge with I. Then gv selects the same block again, and $A adds to the end of each line.","mode":"text/plain","start":"# Plans\n\nPrices are per month, before VAT. Seats are people who can sign in.\n\n| Plan | Price | Seats | Support |\n|------|-------|-------|---------|\nStarter | 9 | 1 | Email\nTeam | 29 | 10 | Email and chat\nBusiness | 79 | 50 | Phone, within four hours\nEnterprise | Ask us | Any | A named contact\n\nYearly plans get two months free.","startCursor":{"line":5,"ch":0},"paths":[{"keys":["j","<C-v>","3","j","I","| ","<Esc>","g","v","$","A"," |","<Esc>"],"tier":"idiomatic","technique":"visual:<C-v>","core":["visual:<C-v>","door-I","door-A"],"note":"A block insert types on every line at once. With $ in the block, A adds at the real end of each line, whatever its length."}],"target":"# Plans\n\nPrices are per month, before VAT. Seats are people who can sign in.\n\n| Plan | Price | Seats | Support |\n|------|-------|-------|---------|\n| Starter | 9 | 1 | Email |\n| Team | 29 | 10 | Email and chat |\n| Business | 79 | 50 | Phone, within four hours |\n| Enterprise | Ask us | Any | A named contact |\n\nYearly plans get two months free.","language":"text","evidence":"guided","canonicalKey":"intermediate.13#0","canonicalFingerprint":"5tb1gl"}]}},"concepts":{"javascript":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Visual selection and insertion.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Edit a column of text on several lines at once. The change shows up when you press Esc.</p><p>Ctrl-v selects a rectangle. I types at its left edge and A at its right edge, and the text appears on every line when you press Esc. Press $ before A to add text at the real end of each line, even when the lines are different lengths. gv selects the same block again, so you can add to the start and then the end. If your browser takes over Ctrl-v, use Keyboard check.</p><h2 class=\"prose-subhead\">Example</h2><p>Select the first column of three notes with Ctrl-v then 2j. Press I, type a bullet and a space, then press Esc to add them to all three lines.</p><p>Use Start over to try again.</p></div></details>"},"python":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Visual selection and insertion.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Edit a column of text on several lines at once. The change shows up when you press Esc.</p><p>Ctrl-v selects a rectangle. I types at its left edge and A at its right edge, and the text appears on every line when you press Esc. Press $ before A to add text at the real end of each line, even when the lines are different lengths. gv selects the same block again, so you can add to the start and then the end. If your browser takes over Ctrl-v, use Keyboard check.</p><h2 class=\"prose-subhead\">Example</h2><p>Select the first column of three notes with Ctrl-v then 2j. Press I, type a bullet and a space, then press Esc to add them to all three lines.</p><p>Use Start over to try again.</p></div></details>"},"text":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Visual selection and insertion.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Edit a column of text on several lines at once. The change shows up when you press Esc.</p><p>Ctrl-v selects a rectangle. I types at its left edge and A at its right edge, and the text appears on every line when you press Esc. Press $ before A to add text at the real end of each line, even when the lines are different lengths. gv selects the same block again, so you can add to the start and then the end. If your browser takes over Ctrl-v, use Keyboard check.</p><h2 class=\"prose-subhead\">Example</h2><p>Select the first column of three notes with Ctrl-v then 2j. Press I, type a bullet and a space, then press Esc to add them to all three lines.</p><p>Use Start over to try again.</p></div></details>"}}}