{"schemaVersion":1,"contentVersion":"3.4.0","id":"intermediate.1","languages":{"javascript":{"id":"intermediate.1","title":"Choose the whole pair","moduleName":"Boundaries and reusable text","tips":"","concept":"<p class=\"lead\">Change what's inside a pair of brackets or quotes, or the pair as well. Start inside the one you mean.</p><p><strong>Before this lesson:</strong> Words and quotations.</p><p>i keeps the pair around the text and a takes the pair too. So ci( changes the arguments and ca( replaces the brackets as well. A bracket pair can span several lines, and inside nested brackets you get the innermost pair. If you start before a call, Vim 9.1 and this editor use the next pair on the line, but older versions of Vim do nothing, so start inside the pair you mean. Quote objects stay inside the quotation you're in.</p><h3>Example</h3><p>From inside (draft), ci( then ready then Esc gives (ready). ca( then ready gives just ready, without the brackets.</p><p>Use Start over to try again.</p>","teaches":["textobject:i(","textobject:a(","textobject:i[","textobject:i{","textobject:i'","textobject-inner"],"introduces":["c","d","i","a","textobject"],"constraints":[],"drills":[{"task":"<code>track</code> takes one event object now. Pass it just the <code>event</code> built on the line above.","hint":"ci( changes everything between the round brackets, from anywhere inside them.","mode":"jsx","start":"import { track } from \"./track\";\nimport { addToCartEvent } from \"./events\";\n\n// Sent when a product goes into the cart. The dashboard counts these per product.\nexport function trackAddToCart(product, quantity) {\n  const event = addToCartEvent(product, quantity);\n  track(\"add_to_cart\", product.sku, product.priceCents, quantity);\n}","startCursor":{"line":6,"ch":26},"paths":[{"keys":["c","i","(","event","<Esc>"],"tier":"idiomatic","technique":"textobject:i(","core":["textobject:i(","textobject-inner"],"note":"ci( changes every argument at once and keeps the brackets."}],"target":"import { track } from \"./track\";\nimport { addToCartEvent } from \"./events\";\n\n// Sent when a product goes into the cart. The dashboard counts these per product.\nexport function trackAddToCart(product, quantity) {\n  const event = addToCartEvent(product, quantity);\n  track(event);\n}","language":"javascript","evidence":"guided","canonicalKey":"intermediate.1#0","canonicalFingerprint":"1pz5dsf"},{"task":"Start with the languages the product already has: replace the two codes with <code>...product.locales</code>.","hint":"Get inside the list's square brackets first. Then ci[ changes what's in them.","mode":"jsx","start":"import { useMemo, useState } from \"react\";\nimport { LocalePicker } from \"./LocalePicker\";\n\n// Lets an editor choose the languages a product page is published in.\nexport function PublishLocales({ product }) {\n  const [locales, setLocales] = useState([\"en-IE\", \"nl-NL\"]);\n  const sorted = useMemo(() => [...locales].sort(), [locales]);\n  return <LocalePicker value={sorted} onChange={setLocales} />;\n}","startCursor":{"line":4,"ch":0},"paths":[{"keys":["j","f","\"","c","i","[","...product.locales","<Esc>"],"tier":"idiomatic","technique":"textobject:i[","core":["textobject:i["],"note":"f\" puts the cursor inside the list, and ci[ empties it and keeps its brackets."}],"target":"import { useMemo, useState } from \"react\";\nimport { LocalePicker } from \"./LocalePicker\";\n\n// Lets an editor choose the languages a product page is published in.\nexport function PublishLocales({ product }) {\n  const [locales, setLocales] = useState([...product.locales]);\n  const sorted = useMemo(() => [...locales].sort(), [locales]);\n  return <LocalePicker value={sorted} onChange={setLocales} />;\n}","language":"javascript","evidence":"guided","canonicalKey":"intermediate.1#1","canonicalFingerprint":"1uxdhy6"},{"task":"Big totals don't fit in the drawer. Make <code>notation: \"compact\"</code> the only format option.","hint":"Get inside the inner curly brackets. Then ci{ changes everything in them.","mode":"jsx","start":"import { Price } from \"../ui/Price\";\n\n// The total at the bottom of the cart drawer.\nexport function DrawerTotal({ cart }) {\n  return (\n    <p className=\"drawer-total\">\n      Total: <Price cents={cart.totalCents} format={{ style: \"currency\", currency: cart.currency, minimumFractionDigits: 2 }} />\n    </p>\n  );\n}","startCursor":{"line":5,"ch":4},"paths":[{"keys":["j","f","\"","c","i","{"," notation: \"compact\" ","<Esc>"],"tier":"idiomatic","technique":"textobject:i{","core":["textobject:i{"],"note":"ci{ changes what's between the curly brackets the cursor is in, here the inner pair."}],"target":"import { Price } from \"../ui/Price\";\n\n// The total at the bottom of the cart drawer.\nexport function DrawerTotal({ cart }) {\n  return (\n    <p className=\"drawer-total\">\n      Total: <Price cents={cart.totalCents} format={{ notation: \"compact\" }} />\n    </p>\n  );\n}","language":"javascript","evidence":"guided","canonicalKey":"intermediate.1#2","canonicalFingerprint":"12o7xay"},{"task":"VAT depends on the country. Use <code>vatMultiplier(cart.country)</code> in place of <code>(1 + 0.21)</code>.","hint":"From inside the second pair of round brackets, ca( replaces the brackets and what they hold.","mode":"jsx","start":"import { vatMultiplier } from \"./tax\";\n\n// What the customer pays, VAT included. Amounts are in cents.\nexport function grandTotal(cart) {\n  const shipping = cart.subtotalCents >= 5000 ? 0 : 495;\n  const gross = (cart.subtotalCents + shipping) * (1 + 0.21) - cart.discountCents;\n  return Math.max(0, Math.round(gross));\n}","startCursor":{"line":4,"ch":2},"paths":[{"keys":["j","f","*","W","c","a","(","vatMultiplier(cart.country)","<Esc>"],"tier":"idiomatic","technique":"textobject:a(","core":["textobject:a("],"note":"ca( takes the brackets too, so nothing is left of (1 + 0.21)."}],"target":"import { vatMultiplier } from \"./tax\";\n\n// What the customer pays, VAT included. Amounts are in cents.\nexport function grandTotal(cart) {\n  const shipping = cart.subtotalCents >= 5000 ? 0 : 495;\n  const gross = (cart.subtotalCents + shipping) * vatMultiplier(cart.country) - cart.discountCents;\n  return Math.max(0, Math.round(gross));\n}","language":"javascript","evidence":"guided","canonicalKey":"intermediate.1#3","canonicalFingerprint":"c41g3s"},{"task":"VAT follows where the order is delivered. Read the country from <code>delivery.iso</code> instead.","hint":"ci' changes what's inside single quotes. It finds the first quoted text on the line if the cursor is before it.","mode":"jsx","start":"import get from 'lodash/get';\nimport { VAT_RATES } from './rates';\n\n// The VAT rate for an order, from the country it's delivered to.\nexport function vatRate(order) {\n  const country = get(order, 'customer.addresses[0].country', 'NL');\n  return VAT_RATES[country] ?? VAT_RATES.NL;\n}","startCursor":{"line":4,"ch":0},"paths":[{"keys":["j","c","i","'","delivery.iso","<Esc>"],"tier":"idiomatic","technique":"textobject:i'","core":["textobject:i'"],"note":"ci' changes the whole path between the quotes, dots and brackets included."}],"target":"import get from 'lodash/get';\nimport { VAT_RATES } from './rates';\n\n// The VAT rate for an order, from the country it's delivered to.\nexport function vatRate(order) {\n  const country = get(order, 'delivery.iso', 'NL');\n  return VAT_RATES[country] ?? VAT_RATES.NL;\n}","language":"javascript","evidence":"guided","canonicalKey":"intermediate.1#4","canonicalFingerprint":"240y9k"},{"task":"Don't override any flags when the app starts: empty the <code>overrides</code> object.","hint":"di{ deletes what's between the curly brackets the cursor is in and keeps the brackets.","mode":"jsx","start":"import { mountApp } from \"./mount\";\n\n// Feature flags for the storefront. Each environment turns them on in its deploy settings.\nexport const featureFlags = {\n  quickBuy: false,\n  giftWrapping: false,\n};\n\n// Starts the storefront with the flags above and any overrides for this page.\nexport function startApp(root) {\n  return mountApp(root, { overrides: { quickBuy: true, giftWrapping: true }, flags: featureFlags });\n}\n\nexport const stopApp = (app) => app.unmount();","startCursor":{"line":10,"ch":2},"paths":[{"keys":["f","q","d","i","{"],"tier":"idiomatic","technique":"textobject:i{","core":["textobject:i{"],"note":"di{ empties the inner object and leaves {} behind."}],"target":"import { mountApp } from \"./mount\";\n\n// Feature flags for the storefront. Each environment turns them on in its deploy settings.\nexport const featureFlags = {\n  quickBuy: false,\n  giftWrapping: false,\n};\n\n// Starts the storefront with the flags above and any overrides for this page.\nexport function startApp(root) {\n  return mountApp(root, { overrides: {}, flags: featureFlags });\n}\n\nexport const stopApp = (app) => app.unmount();","language":"javascript","evidence":"guided","canonicalKey":"intermediate.1#5","canonicalFingerprint":"jbti7u"}]},"python":{"id":"intermediate.1","title":"Choose the whole pair","moduleName":"Boundaries and reusable text","tips":"","concept":"<p class=\"lead\">Change what's inside a pair of brackets or quotes, or the pair as well. Start inside the one you mean.</p><p><strong>Before this lesson:</strong> Words and quotations.</p><p>i keeps the pair around the text and a takes the pair too. So ci( changes the arguments and ca( replaces the brackets as well. A bracket pair can span several lines, and inside nested brackets you get the innermost pair. If you start before a call, Vim 9.1 and this editor use the next pair on the line, but older versions of Vim do nothing, so start inside the pair you mean. Quote objects stay inside the quotation you're in.</p><h3>Example</h3><p>From inside (draft), ci( then ready then Esc gives (ready). ca( then ready gives just ready, without the brackets.</p><p>Use Start over to try again.</p>","teaches":["textobject:i(","textobject:a(","textobject:i[","textobject:i{","textobject:i'","textobject-inner"],"introduces":["c","d","i","a","textobject"],"constraints":[],"drills":[{"task":"<code>track</code> takes one event now. Pass it just the <code>event</code> built on the line above.","hint":"ci( changes everything between the round brackets, from anywhere inside them.","mode":"python","start":"from shop.analytics.client import track\nfrom shop.analytics.events import add_to_cart_event\n\n\ndef track_add_to_cart(product, quantity):\n    \"\"\"Sent when a product goes into the cart. The dashboard counts these per product.\"\"\"\n    event = add_to_cart_event(product, quantity)\n    track(\"add_to_cart\", product.sku, product.price_cents, quantity)","startCursor":{"line":7,"ch":28},"paths":[{"keys":["c","i","(","event","<Esc>"],"tier":"idiomatic","technique":"textobject:i(","core":["textobject:i(","textobject-inner"],"note":"ci( changes every argument at once and keeps the brackets."}],"target":"from shop.analytics.client import track\nfrom shop.analytics.events import add_to_cart_event\n\n\ndef track_add_to_cart(product, quantity):\n    \"\"\"Sent when a product goes into the cart. The dashboard counts these per product.\"\"\"\n    event = add_to_cart_event(product, quantity)\n    track(event)","language":"python","evidence":"guided","canonicalKey":"intermediate.1#0","canonicalFingerprint":"1pz5dsf"},{"task":"Belgium gets the default locales now: replace its two codes with <code>*DEFAULT_LOCALES</code>.","hint":"Get onto the list's square brackets first. Then ci[ changes what's in them.","mode":"python","start":"\"\"\"The languages each country's shop is shown in. The first one is the default.\"\"\"\n\nDEFAULT_LOCALES = [\"en-IE\", \"nl-NL\"]\n\nLOCALES_BY_COUNTRY = {}\nLOCALES_BY_COUNTRY[\"nl\"] = [\"nl-NL\", \"en-IE\"]\nLOCALES_BY_COUNTRY[\"be\"] = [\"nl-BE\", \"fr-BE\"]\nLOCALES_BY_COUNTRY[\"de\"] = [\"de-DE\", \"en-IE\"]","startCursor":{"line":5,"ch":0},"paths":[{"keys":["j","$","c","i","[","*DEFAULT_LOCALES","<Esc>"],"tier":"idiomatic","technique":"textobject:i[","core":["textobject:i["],"note":"$ lands on the list's closing bracket, and ci[ works from there too. Starting at the line's first bracket would change \"be\"."}],"target":"\"\"\"The languages each country's shop is shown in. The first one is the default.\"\"\"\n\nDEFAULT_LOCALES = [\"en-IE\", \"nl-NL\"]\n\nLOCALES_BY_COUNTRY = {}\nLOCALES_BY_COUNTRY[\"nl\"] = [\"nl-NL\", \"en-IE\"]\nLOCALES_BY_COUNTRY[\"be\"] = [*DEFAULT_LOCALES]\nLOCALES_BY_COUNTRY[\"de\"] = [\"de-DE\", \"en-IE\"]","language":"python","evidence":"guided","canonicalKey":"intermediate.1#1","canonicalFingerprint":"1uxdhy6"},{"task":"Say where the parcel goes in the customer's own words: make the second placeholder <code>{destination}</code>.","hint":"Get inside the second pair of curly brackets. Then ci{ changes what's in them.","mode":"python","start":"\"\"\"Subject lines for the order emails.\"\"\"\n\n\ndef shipped_subject(order, destination):\n    \"\"\"`destination` is how the customer wrote the place at checkout.\"\"\"\n    return f\"Order {order.number} is on its way to {order.shipping_address.city.title()}\"\n\n\ndef delivered_subject(order):\n    return f\"Order {order.number} was delivered\"","startCursor":{"line":4,"ch":21},"paths":[{"keys":["j","$","h","c","i","{","destination","<Esc>"],"tier":"idiomatic","technique":"textobject:i{","core":["textobject:i{"],"note":"ci{ changes what's between the curly brackets the cursor is on, and keeps them."}],"target":"\"\"\"Subject lines for the order emails.\"\"\"\n\n\ndef shipped_subject(order, destination):\n    \"\"\"`destination` is how the customer wrote the place at checkout.\"\"\"\n    return f\"Order {order.number} is on its way to {destination}\"\n\n\ndef delivered_subject(order):\n    return f\"Order {order.number} was delivered\"","language":"python","evidence":"guided","canonicalKey":"intermediate.1#2","canonicalFingerprint":"12o7xay"},{"task":"VAT depends on the country. Use <code>vat_multiplier(cart.country)</code> in place of <code>(1 + settings.STANDARD_VAT_RATE)</code>.","hint":"From inside the second pair of round brackets, ca( replaces the brackets and what they hold.","mode":"python","start":"from shop import settings\nfrom shop.tax import vat_multiplier\n\n\ndef grand_total(cart):\n    \"\"\"What the customer pays in cents, VAT included.\"\"\"\n    shipping = 0 if cart.subtotal_cents >= 5000 else 495\n    gross = (cart.subtotal_cents + shipping) * (1 + settings.STANDARD_VAT_RATE) - cart.discount_cents\n    return max(0, round(gross))\n\n\ndef vat_part(cart):\n    return grand_total(cart) - cart.subtotal_cents","startCursor":{"line":6,"ch":4},"paths":[{"keys":["j","f","*","W","c","a","(","vat_multiplier(cart.country)","<Esc>"],"tier":"idiomatic","technique":"textobject:a(","core":["textobject:a("],"note":"ca( takes the brackets too, so nothing is left of the old rate."}],"target":"from shop import settings\nfrom shop.tax import vat_multiplier\n\n\ndef grand_total(cart):\n    \"\"\"What the customer pays in cents, VAT included.\"\"\"\n    shipping = 0 if cart.subtotal_cents >= 5000 else 495\n    gross = (cart.subtotal_cents + shipping) * vat_multiplier(cart.country) - cart.discount_cents\n    return max(0, round(gross))\n\n\ndef vat_part(cart):\n    return grand_total(cart) - cart.subtotal_cents","language":"python","evidence":"guided","canonicalKey":"intermediate.1#3","canonicalFingerprint":"c41g3s"},{"task":"VAT follows where the order is delivered. Read the country from <code>delivery.iso</code> instead.","hint":"ci' changes what's inside single quotes. It finds the first quoted text on the line if the cursor is before it.","mode":"python","start":"from glom import glom\n\nfrom shop.tax.rates import VAT_RATES\n\n\ndef vat_rate(order):\n    \"\"\"The VAT rate for an order, from the country it's delivered to.\"\"\"\n    country = glom(order, 'customer.addresses.0.country', default='NL')\n    return VAT_RATES.get(country, VAT_RATES['NL'])","startCursor":{"line":6,"ch":4},"paths":[{"keys":["j","c","i","'","delivery.iso","<Esc>"],"tier":"idiomatic","technique":"textobject:i'","core":["textobject:i'"],"note":"ci' changes the whole path between the quotes, dots included."}],"target":"from glom import glom\n\nfrom shop.tax.rates import VAT_RATES\n\n\ndef vat_rate(order):\n    \"\"\"The VAT rate for an order, from the country it's delivered to.\"\"\"\n    country = glom(order, 'delivery.iso', default='NL')\n    return VAT_RATES.get(country, VAT_RATES['NL'])","language":"python","evidence":"guided","canonicalKey":"intermediate.1#4","canonicalFingerprint":"240y9k"},{"task":"Don't override any flags when the app starts: empty the <code>overrides</code> dict.","hint":"di{ deletes what's between the curly brackets the cursor is in and keeps the brackets.","mode":"python","start":"from shop.web import mount_app\n\nFEATURE_FLAGS = {\n    \"quick_buy\": False,\n    \"gift_wrapping\": False,\n}\n\n\ndef start_app(root):\n    \"\"\"Starts the shop with the flags above and any overrides for this page.\"\"\"\n    return mount_app(root, overrides={\"quick_buy\": True, \"gift_wrapping\": True}, flags=FEATURE_FLAGS)\n\n\ndef stop_app(app):\n    app.unmount()","startCursor":{"line":10,"ch":4},"paths":[{"keys":["f","q","d","i","{"],"tier":"idiomatic","technique":"textobject:i{","core":["textobject:i{"],"note":"di{ empties the dict and leaves {} behind."}],"target":"from shop.web import mount_app\n\nFEATURE_FLAGS = {\n    \"quick_buy\": False,\n    \"gift_wrapping\": False,\n}\n\n\ndef start_app(root):\n    \"\"\"Starts the shop with the flags above and any overrides for this page.\"\"\"\n    return mount_app(root, overrides={}, flags=FEATURE_FLAGS)\n\n\ndef stop_app(app):\n    app.unmount()","language":"python","evidence":"guided","canonicalKey":"intermediate.1#5","canonicalFingerprint":"jbti7u"}]},"text":{"id":"intermediate.1","title":"Choose the whole pair","moduleName":"Boundaries and reusable text","tips":"","concept":"<p class=\"lead\">Change what's inside a pair of brackets or quotes, or the pair as well. Start inside the one you mean.</p><p><strong>Before this lesson:</strong> Words and quotations.</p><p>i keeps the pair around the text and a takes the pair too. So ci( changes the arguments and ca( replaces the brackets as well. A bracket pair can span several lines, and inside nested brackets you get the innermost pair. If you start before a call, Vim 9.1 and this editor use the next pair on the line, but older versions of Vim do nothing, so start inside the pair you mean. Quote objects stay inside the quotation you're in.</p><h3>Example</h3><p>From inside (draft), ci( then ready then Esc gives (ready). ca( then ready gives just ready, without the brackets.</p><p>Use Start over to try again.</p>","teaches":["textobject:i(","textobject:a(","textobject:i[","textobject:i{","textobject:i'","textobject-inner"],"introduces":["c","d","i","a","textobject"],"constraints":[],"drills":[{"task":"The help centre moved. Point the returns link at <code>/kb/7</code>.","hint":"ci( changes everything between the round brackets, from anywhere inside them.","mode":"text/plain","start":"# Returns\n\nYou can return anything within 30 days. See the [returns policy](https://help.northwind.shop/articles/returns-and-refunds-2024) for the details.\n\nRefunds go back to the card you paid with.","startCursor":{"line":2,"ch":96},"paths":[{"keys":["c","i","(","/kb/7","<Esc>"],"tier":"idiomatic","technique":"textobject:i(","core":["textobject:i(","textobject-inner"],"note":"ci( changes the whole address and keeps the brackets around it."}],"target":"# Returns\n\nYou can return anything within 30 days. See the [returns policy](/kb/7) for the details.\n\nRefunds go back to the card you paid with.","language":"text","evidence":"guided","canonicalKey":"intermediate.1#0","canonicalFingerprint":"1pz5dsf"},{"task":"The onboarding guide was replaced. Make the link's text <code>handbook</code>.","hint":"Get inside the link's square brackets. Then ci[ changes what's in them.","mode":"text/plain","start":"# Starting at Northwind\n\n- [ ] Get your laptop from IT on Monday morning.\n- [ ] Ask Dana for access to the shared drive and read the [old onboarding guide, 2023 edition](/wiki/onboarding)\n- [ ] Join the support rota on Thursday.\n- [ ] Book a coffee with someone from the warehouse.","startCursor":{"line":3,"ch":6},"paths":[{"keys":["f","[","c","i","[","handbook","<Esc>"],"tier":"idiomatic","technique":"textobject:i[","core":["textobject:i["],"note":"f[ puts the cursor on the link's bracket, and ci[ changes its text."}],"target":"# Starting at Northwind\n\n- [ ] Get your laptop from IT on Monday morning.\n- [ ] Ask Dana for access to the shared drive and read the [handbook](/wiki/onboarding)\n- [ ] Join the support rota on Thursday.\n- [ ] Book a coffee with someone from the warehouse.","language":"text","evidence":"guided","canonicalKey":"intermediate.1#1","canonicalFingerprint":"1uxdhy6"},{"task":"Use the tracking code in the subject: make the second placeholder <code>{{shipment.tracking_code}}</code>.","hint":"Get inside the second placeholder's inner curly brackets. Then ci{ changes what's in them.","mode":"text/plain","start":"Subject: Hi {{customer.first_name}}, order {{order.number}} is on its way\n\nDear {{customer.name}},\n\nYour parcel left our warehouse today. You can follow it on the carrier's site.\n\nThe Northwind shipping team","startCursor":{"line":0,"ch":0},"paths":[{"keys":["f",".",";","c","i","{","shipment.tracking_code","<Esc>"],"tier":"idiomatic","technique":"textobject:i{","core":["textobject:i{"],"note":"ci{ changes what's in the inner curly brackets and keeps both pairs."}],"target":"Subject: Hi {{customer.first_name}}, order {{shipment.tracking_code}} is on its way\n\nDear {{customer.name}},\n\nYour parcel left our warehouse today. You can follow it on the carrier's site.\n\nThe Northwind shipping team","language":"text","evidence":"guided","canonicalKey":"intermediate.1#2","canonicalFingerprint":"12o7xay"},{"task":"The Dutch exception is gone. Replace the brackets and what's in them with <code>everywhere</code>.","hint":"From inside the brackets, ca( replaces the brackets and what they hold.","mode":"text/plain","start":"# Delivery\n\nMost orders arrive in two working days.\nDelivery is free on orders over 50 euros (40 euros if you live in the Netherlands) and takes two days.\nFurniture comes on a pallet, so someone needs to be home.\n\nTrack your parcel from the link in your shipping email.","startCursor":{"line":2,"ch":0},"paths":[{"keys":["j","f","(","c","a","(","everywhere","<Esc>"],"tier":"idiomatic","technique":"textobject:a(","core":["textobject:a("],"note":"ca( takes the brackets too, so only everywhere is left."}],"target":"# Delivery\n\nMost orders arrive in two working days.\nDelivery is free on orders over 50 euros everywhere and takes two days.\nFurniture comes on a pallet, so someone needs to be home.\n\nTrack your parcel from the link in your shipping email.","language":"text","evidence":"guided","canonicalKey":"intermediate.1#3","canonicalFingerprint":"c41g3s"},{"task":"We exclude the log files now, not <code>node_modules</code>. Make the exclude pattern <code>*.log</code>.","hint":"ci' changes what's inside single quotes. It finds the first quoted text on the line if the cursor is before it.","mode":"text/plain","start":"# Deploying the storefront\n\nBuild it first with `npm run build`. Then copy the files to the server:\n\n    rsync -az --delete --exclude 'node_modules' ./dist/ deploy@shop-01:/srv/shop\n\nRestart the service afterwards, or the old files stay in memory.","startCursor":{"line":2,"ch":0},"paths":[{"keys":["2","j","c","i","'","*.log","<Esc>"],"tier":"idiomatic","technique":"textobject:i'","core":["textobject:i'"],"note":"ci' jumps to the quotes on the line and changes what's between them."}],"target":"# Deploying the storefront\n\nBuild it first with `npm run build`. Then copy the files to the server:\n\n    rsync -az --delete --exclude '*.log' ./dist/ deploy@shop-01:/srv/shop\n\nRestart the service afterwards, or the old files stay in memory.","language":"text","evidence":"guided","canonicalKey":"intermediate.1#4","canonicalFingerprint":"240y9k"},{"task":"The labels are set by the platform now. Empty the <code>labels</code> map.","hint":"di{ deletes what's between the curly brackets the cursor is in and keeps the brackets.","mode":"text/plain","start":"name: storefront\nimage: northwind/storefront:4.3.0\nreplicas: 3\nlabels: { team: checkout, owner: dana, cost-centre: web }\nenv:\n  NODE_ENV: production\n  PORT: \"3000\"","startCursor":{"line":3,"ch":0},"paths":[{"keys":["$","d","i","{"],"tier":"idiomatic","technique":"textobject:i{","core":["textobject:i{"],"note":"$ lands on the closing bracket, and di{ works from there. It leaves {} behind."}],"target":"name: storefront\nimage: northwind/storefront:4.3.0\nreplicas: 3\nlabels: {}\nenv:\n  NODE_ENV: production\n  PORT: \"3000\"","language":"text","evidence":"guided","canonicalKey":"intermediate.1#5","canonicalFingerprint":"jbti7u"}]}},"concepts":{"javascript":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Words and quotations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Change what's inside a pair of brackets or quotes, or the pair as well. Start inside the one you mean.</p><p>i keeps the pair around the text and a takes the pair too. So ci( changes the arguments and ca( replaces the brackets as well. A bracket pair can span several lines, and inside nested brackets you get the innermost pair. If you start before a call, Vim 9.1 and this editor use the next pair on the line, but older versions of Vim do nothing, so start inside the pair you mean. Quote objects stay inside the quotation you're in.</p><h2 class=\"prose-subhead\">Example</h2><p>From inside (draft), ci( then ready then Esc gives (ready). ca( then ready gives just ready, without the brackets.</p><p>Use Start over to try again.</p></div></details>"},"python":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Words and quotations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Change what's inside a pair of brackets or quotes, or the pair as well. Start inside the one you mean.</p><p>i keeps the pair around the text and a takes the pair too. So ci( changes the arguments and ca( replaces the brackets as well. A bracket pair can span several lines, and inside nested brackets you get the innermost pair. If you start before a call, Vim 9.1 and this editor use the next pair on the line, but older versions of Vim do nothing, so start inside the pair you mean. Quote objects stay inside the quotation you're in.</p><h2 class=\"prose-subhead\">Example</h2><p>From inside (draft), ci( then ready then Esc gives (ready). ca( then ready gives just ready, without the brackets.</p><p>Use Start over to try again.</p></div></details>"},"text":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Words and quotations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Change what's inside a pair of brackets or quotes, or the pair as well. Start inside the one you mean.</p><p>i keeps the pair around the text and a takes the pair too. So ci( changes the arguments and ca( replaces the brackets as well. A bracket pair can span several lines, and inside nested brackets you get the innermost pair. If you start before a call, Vim 9.1 and this editor use the next pair on the line, but older versions of Vim do nothing, so start inside the pair you mean. Quote objects stay inside the quotation you're in.</p><h2 class=\"prose-subhead\">Example</h2><p>From inside (draft), ci( then ready then Esc gives (ready). ca( then ready gives just ready, without the brackets.</p><p>Use Start over to try again.</p></div></details>"}}}