{"schemaVersion":1,"contentVersion":"3.4.0","id":"foundation.9","languages":{"javascript":{"id":"foundation.9","title":"Find a character boundary","moduleName":"Search and apply","tips":"","concept":"<p class=\"lead\">Know whether a character search lands on the character or next to it.</p><p><strong>Before this lesson:</strong> Compose an edit and the word and quotation lessons.</p><p>f finds a character to the right on the current line and t stops just before it. F searches to the left and T stops just after the character it finds. ; repeats the search and a comma repeats it in the other direction. None of them leave the current line. A count picks a later match, as in 2f,.</p><div class=\"pkeys\"><kbd>f</kbd> <kbd>t</kbd> <kbd>F</kbd> <kbd>T</kbd> <kbd>;</kbd> <kbd>,</kbd></div><h3>Example</h3><p>On “red, blue, green”, f, from r lands on the first comma and t, lands on d. From g, F, lands on the comma before green and T, lands on the space after it. dt, from r deletes up to the comma and keeps the comma itself.</p><h4>Worked text</h4><pre class=\"lesson-example\">const message = \"red, blue, green\";</pre><p>Use Start over to try again.</p>","teaches":["char-search"],"introduces":["f","t","F","T",";",","],"constraints":[],"drills":[{"task":"Put the cursor on the <code>(</code> after <code>formatPrice</code>.","hint":"The character is back along the line. F jumps back to it in one move.","mode":"jsx","start":"import { formatPrice } from \"../lib/money.js\";\n\nexport function OrderRow({ order }) {\n  const label = order.total > 0 ? formatPrice(order.total, order.currency) : \"Free\";\n  return (\n    <tr>\n      <td>{order.number}</td>\n      <td>{label}</td>\n    </tr>\n  );\n}","startCursor":{"line":3,"ch":84},"paths":[{"keys":["F","("],"tier":"idiomatic","technique":"motion:F","core":["motion:F"],"note":"F and a character jump back to the nearest one on the line, however far back it is."}],"kind":"navigate","land":{"line":3,"ch":45},"language":"javascript","evidence":"guided","canonicalKey":"foundation.9#0","canonicalFingerprint":"jvzx5o"},{"task":"The warehouse screen shows 50 orders at a time. Add <code>&amp;limit=50</code> to the end of the query.","hint":"The new text goes just before the closing character. t stops right before it, and a adds text after the cursor.","mode":"jsx","start":"import { request } from \"./client.js\";\n\n// The orders the warehouse screen lists.\nexport function warehouseOrders() {\n  return request(\"/api/v2/warehouse/orders?status=open&sort=-created&from=2026-10-01\");\n}","startCursor":{"line":4,"ch":43},"paths":[{"keys":["t","\"","a","&limit=50","<Esc>"],"tier":"idiomatic","technique":"motion:t","core":["motion:t"],"note":"t stops just before the character, so a puts the text in right before it."}],"target":"import { request } from \"./client.js\";\n\n// The orders the warehouse screen lists.\nexport function warehouseOrders() {\n  return request(\"/api/v2/warehouse/orders?status=open&sort=-created&from=2026-10-01&limit=50\");\n}","language":"javascript","evidence":"guided","canonicalKey":"foundation.9#1","canonicalFingerprint":"14dmige"},{"task":"Put the cursor on the first letter of the CSS file's name, <code>order-summary-card</code>.","hint":"The name starts just after the last slash. T/ searches back and stops just after it.","mode":"jsx","start":"import { formatPrice } from \"../../lib/money.js\";\nimport styles from \"../../styles/checkout/order-summary-card.module.css\";\n\nexport function OrderSummary({ order }) {\n  return (\n    <section className={styles.card}>\n      <h2>Order summary</h2>\n      <p className={styles.total}>{formatPrice(order.total)}</p>\n    </section>\n  );\n}","startCursor":{"line":1,"ch":72},"paths":[{"keys":["T","/"],"tier":"idiomatic","technique":"motion:T","core":["motion:T"],"note":"T/ goes back to just after the slash, where the name starts."}],"kind":"navigate","land":{"line":1,"ch":42},"language":"javascript","evidence":"guided","canonicalKey":"foundation.9#2","canonicalFingerprint":"x9flj7"},{"task":"Safari can't read the date <code>2026/11/27</code>. Write it with dashes, <code>2026-11-27</code>, as the other dates are.","hint":"f/ finds the first slash. After you replace it, ; repeats the search for the next one.","mode":"jsx","start":"// The winter sale. Dates are in the shop's time zone.\nexport const sale = {\n  name: \"Winter sale\",\n  starts: new Date(\"2026/11/27 09:00\"), // Black Friday, at opening time\n  ends: new Date(\"2026-12-07T23:59\"),\n  banner: \"Up to 40% off coats and boots\",\n};","startCursor":{"line":3,"ch":2},"paths":[{"keys":["f","/","r","-",";","r","-"],"tier":"idiomatic","technique":"char-search-repeat:;","core":["char-search-repeat:;"],"note":"; repeats the last f, so the second slash is one key away."}],"target":"// The winter sale. Dates are in the shop's time zone.\nexport const sale = {\n  name: \"Winter sale\",\n  starts: new Date(\"2026-11-27 09:00\"), // Black Friday, at opening time\n  ends: new Date(\"2026-12-07T23:59\"),\n  banner: \"Up to 40% off coats and boots\",\n};","language":"javascript","evidence":"guided","canonicalKey":"foundation.9#3","canonicalFingerprint":"z9and1"}]},"python":{"id":"foundation.9","title":"Find a character boundary","moduleName":"Search and apply","tips":"","concept":"<p class=\"lead\">Know whether a character search lands on the character or next to it.</p><p><strong>Before this lesson:</strong> Compose an edit and the word and quotation lessons.</p><p>f finds a character to the right on the current line and t stops just before it. F searches to the left and T stops just after the character it finds. ; repeats the search and a comma repeats it in the other direction. None of them leave the current line. A count picks a later match, as in 2f,.</p><div class=\"pkeys\"><kbd>f</kbd> <kbd>t</kbd> <kbd>F</kbd> <kbd>T</kbd> <kbd>;</kbd> <kbd>,</kbd></div><h3>Example</h3><p>On “red, blue, green”, f, from r lands on the first comma and t, lands on d. From g, F, lands on the comma before green and T, lands on the space after it. dt, from r deletes up to the comma and keeps the comma itself.</p><h4>Worked text</h4><pre class=\"lesson-example\">message = \"red, blue, green\"</pre><p>Use Start over to try again.</p>","teaches":["char-search"],"introduces":["f","t","F","T",";",","],"constraints":[],"drills":[{"task":"Put the cursor on the <code>(</code> after <code>format_price</code>.","hint":"The character is back along the line. F jumps back to it in one move.","mode":"python","start":"from django import template\n\nfrom shop.money import format_price\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef order_label(order):\n    return f\"Order {order.number}: {format_price(order.total, order.currency, locale='nl')}\"","startCursor":{"line":9,"ch":91},"paths":[{"keys":["F","("],"tier":"idiomatic","technique":"motion:F","core":["motion:F"],"note":"F and a character jump back to the nearest one on the line, however far back it is."}],"kind":"navigate","land":{"line":9,"ch":48},"language":"python","evidence":"guided","canonicalKey":"foundation.9#0","canonicalFingerprint":"jvzx5o"},{"task":"The warehouse screen shows 50 orders at a time. Add <code>&amp;limit=50</code> to the end of the query.","hint":"The new text goes just before the closing character. t stops right before it, and a adds text after the cursor.","mode":"python","start":"from shop.api import client\n\n\ndef warehouse_orders():\n    \"\"\"The orders the warehouse screen lists.\"\"\"\n    return client.get(\"/api/v2/warehouse/orders?status=open&sort=-created&since=2026-10-01\")","startCursor":{"line":5,"ch":48},"paths":[{"keys":["t","\"","a","&limit=50","<Esc>"],"tier":"idiomatic","technique":"motion:t","core":["motion:t"],"note":"t stops just before the character, so a puts the text in right before it."}],"target":"from shop.api import client\n\n\ndef warehouse_orders():\n    \"\"\"The orders the warehouse screen lists.\"\"\"\n    return client.get(\"/api/v2/warehouse/orders?status=open&sort=-created&since=2026-10-01&limit=50\")","language":"python","evidence":"guided","canonicalKey":"foundation.9#1","canonicalFingerprint":"14dmige"},{"task":"Put the cursor on the first letter of the stylesheet's name, <code>order-summary-box</code>.","hint":"The name starts just after the last slash. T/ searches back and stops just after it.","mode":"python","start":"from pathlib import Path\n\nBASE_DIR = Path(__file__).resolve().parent.parent\n\nSTATIC_URL = \"/static/\"\nSTATIC_ROOT = BASE_DIR / \"static\"\nCHECKOUT_CSS = \"css/checkout/order-summary-box.v2.min.css\"","startCursor":{"line":6,"ch":57},"paths":[{"keys":["T","/"],"tier":"idiomatic","technique":"motion:T","core":["motion:T"],"note":"T/ goes back to just after the slash, where the name starts."}],"kind":"navigate","land":{"line":6,"ch":29},"language":"python","evidence":"guided","canonicalKey":"foundation.9#2","canonicalFingerprint":"x9flj7"},{"task":"fromisoformat only reads dates with dashes. Write <code>2026/11/27</code> as <code>2026-11-27</code>, as the end date is.","hint":"f/ finds the first slash. After you replace it, ; repeats the search for the next one.","mode":"python","start":"\"\"\"The winter sale. Dates are in the shop's time zone.\"\"\"\nfrom datetime import datetime\n\nSALE_NAME = \"Winter sale\"\nSALE_STARTS = datetime.fromisoformat(\"2026/11/27 09:00\")  # Black Friday, at opening time\nSALE_ENDS = datetime.fromisoformat(\"2026-12-07 23:59\")\nBANNER = \"Up to 40% off coats and boots\"","startCursor":{"line":4,"ch":0},"paths":[{"keys":["f","/","r","-",";","r","-"],"tier":"idiomatic","technique":"char-search-repeat:;","core":["char-search-repeat:;"],"note":"; repeats the last f, so the second slash is one key away."}],"target":"\"\"\"The winter sale. Dates are in the shop's time zone.\"\"\"\nfrom datetime import datetime\n\nSALE_NAME = \"Winter sale\"\nSALE_STARTS = datetime.fromisoformat(\"2026-11-27 09:00\")  # Black Friday, at opening time\nSALE_ENDS = datetime.fromisoformat(\"2026-12-07 23:59\")\nBANNER = \"Up to 40% off coats and boots\"","language":"python","evidence":"guided","canonicalKey":"foundation.9#3","canonicalFingerprint":"z9and1"}]},"text":{"id":"foundation.9","title":"Find a character boundary","moduleName":"Search and apply","tips":"","concept":"<p class=\"lead\">Know whether a character search lands on the character or next to it.</p><p><strong>Before this lesson:</strong> Compose an edit and the word and quotation lessons.</p><p>f finds a character to the right on the current line and t stops just before it. F searches to the left and T stops just after the character it finds. ; repeats the search and a comma repeats it in the other direction. None of them leave the current line. A count picks a later match, as in 2f,.</p><div class=\"pkeys\"><kbd>f</kbd> <kbd>t</kbd> <kbd>F</kbd> <kbd>T</kbd> <kbd>;</kbd> <kbd>,</kbd></div><h3>Example</h3><p>On “red, blue, green”, f, from r lands on the first comma and t, lands on d. From g, F, lands on the comma before green and T, lands on the space after it. dt, from r deletes up to the comma and keeps the comma itself.</p><h4>Worked text</h4><pre class=\"lesson-example\">Message: red, blue, green</pre><p>Use Start over to try again.</p>","teaches":["char-search"],"introduces":["f","t","F","T",";",","],"constraints":[],"drills":[{"task":"Put the cursor on the <code>@</code> in the email address.","hint":"The character is back along the line. F jumps back to it in one move.","mode":"text/plain","start":"# Deliveries\n\nDrivers check in at the gate and wait for a dock to free up.\nHours are Monday to Friday, 7:00 to 15:00, at Dock B.\nIf a delivery is late or damaged, write to deliveries@northwind.shop with your order number and a photo.\nPallets over 900 kg go to Dock C.","startCursor":{"line":4,"ch":103},"paths":[{"keys":["F","@"],"tier":"idiomatic","technique":"motion:F","core":["motion:F"],"note":"F and a character jump back to the nearest one on the line, however far back it is."}],"kind":"navigate","land":{"line":4,"ch":53},"language":"text","evidence":"guided","canonicalKey":"foundation.9#0","canonicalFingerprint":"jvzx5o"},{"task":"Dana reads Dutch. Add <code>&amp;lang=nl</code> to the end of the help link, so the page opens in Dutch.","hint":"The new text goes just before the closing character. t stops right before it, and a adds text after the cursor.","mode":"text/plain","start":"Subject: Your receipt for order 1042\n\nHi Dana,\n\nThanks for your order. Your receipt is attached.\nIf you have questions, see our help page (https://northwind.shop/help?ref=mail&utm_source=receipt&utm_medium=email).\n\nNorthwind, customer care","startCursor":{"line":5,"ch":70},"paths":[{"keys":["t",")","a","&lang=nl","<Esc>"],"tier":"idiomatic","technique":"motion:t","core":["motion:t"],"note":"t stops just before the character, so a puts the text in right before it."}],"target":"Subject: Your receipt for order 1042\n\nHi Dana,\n\nThanks for your order. Your receipt is attached.\nIf you have questions, see our help page (https://northwind.shop/help?ref=mail&utm_source=receipt&utm_medium=email&lang=nl).\n\nNorthwind, customer care","language":"text","evidence":"guided","canonicalKey":"foundation.9#1","canonicalFingerprint":"14dmige"},{"task":"Put the cursor on the first letter of the log file's name, <code>order-sync-errors</code>.","hint":"The name starts just after the last slash. T/ searches back and stops just after it.","mode":"text/plain","start":"## Logs\n\nEach service writes its own log file, and they rotate every night.\nThe worker that syncs orders logs its failures to /var/log/northwind/order-sync-errors.2026-11.log\n\nLook there first when an order is stuck.\nAsk in #ops if a file is missing.","startCursor":{"line":3,"ch":97},"paths":[{"keys":["T","/"],"tier":"idiomatic","technique":"motion:T","core":["motion:T"],"note":"T/ goes back to just after the slash, where the name starts."}],"kind":"navigate","land":{"line":3,"ch":69},"language":"text","evidence":"guided","canonicalKey":"foundation.9#2","canonicalFingerprint":"x9flj7"},{"task":"The site writes dates with dashes. Make <code>2026/11/27</code> read <code>2026-11-27</code>, like the end date.","hint":"f/ finds the first slash. After you replace it, ; repeats the search for the next one.","mode":"text/plain","start":"---\ntitle: Our winter sale starts on Black Friday\nauthor: Priya\nstarts: 2026/11/27 at 09:00, when the shop opens\nends: 2026-12-07\n---\n\nUp to 40% off coats and boots, in the shop and online.","startCursor":{"line":3,"ch":0},"paths":[{"keys":["f","/","r","-",";","r","-"],"tier":"idiomatic","technique":"char-search-repeat:;","core":["char-search-repeat:;"],"note":"; repeats the last f, so the second slash is one key away."}],"target":"---\ntitle: Our winter sale starts on Black Friday\nauthor: Priya\nstarts: 2026-11-27 at 09:00, when the shop opens\nends: 2026-12-07\n---\n\nUp to 40% off coats and boots, in the shop and online.","language":"text","evidence":"guided","canonicalKey":"foundation.9#3","canonicalFingerprint":"z9and1"}]}},"concepts":{"javascript":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Compose an edit and the word and quotation lessons.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Know whether a character search lands on the character or next to it.</p><p>f finds a character to the right on the current line and t stops just before it. F searches to the left and T stops just after the character it finds. ; repeats the search and a comma repeats it in the other direction. None of them leave the current line. A count picks a later match, as in 2f,.</p><h2 class=\"prose-subhead\">Example</h2><p>On “red, blue, green”, f, from r lands on the first comma and t, lands on d. From g, F, lands on the comma before green and T, lands on the space after it. dt, from r deletes up to the comma and keeps the comma itself.</p><p>Use Start over to try again.</p></div></details>"},"python":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Compose an edit and the word and quotation lessons.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Know whether a character search lands on the character or next to it.</p><p>f finds a character to the right on the current line and t stops just before it. F searches to the left and T stops just after the character it finds. ; repeats the search and a comma repeats it in the other direction. None of them leave the current line. A count picks a later match, as in 2f,.</p><h2 class=\"prose-subhead\">Example</h2><p>On “red, blue, green”, f, from r lands on the first comma and t, lands on d. From g, F, lands on the comma before green and T, lands on the space after it. dt, from r deletes up to the comma and keeps the comma itself.</p><p>Use Start over to try again.</p></div></details>"},"text":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Compose an edit and the word and quotation lessons.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Know whether a character search lands on the character or next to it.</p><p>f finds a character to the right on the current line and t stops just before it. F searches to the left and T stops just after the character it finds. ; repeats the search and a comma repeats it in the other direction. None of them leave the current line. A count picks a later match, as in 2f,.</p><h2 class=\"prose-subhead\">Example</h2><p>On “red, blue, green”, f, from r lands on the first comma and t, lands on d. From g, F, lands on the comma before green and T, lands on the space after it. dt, from r deletes up to the comma and keeps the comma itself.</p><p>Use Start over to try again.</p></div></details>"}}}