{"schemaVersion":1,"contentVersion":"3.4.0","id":"foundation.1","languages":{"javascript":{"id":"foundation.1","title":"First edits and modes","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Switch into Insert mode and back, then move to a letter and fix it.</p><p><strong>Before this lesson:</strong> Start here: Your first Vim edit.</p><p>In Normal mode your keys are commands, and in Insert mode they type text. i starts typing before the cursor and Esc takes you back to Normal mode. h, j, k and l move left, down, up and right. x deletes the character under the cursor. r followed by a character replaces just that one character, and you stay in Normal mode.</p><div class=\"pkeys\"><kbd>i</kbd> <kbd>Esc</kbd> <kbd>h</kbd> <kbd>j</kbd> <kbd>k</kbd> <kbd>l</kbd> <kbd>x</kbd> <kbd>r</kbd></div><h3>Example</h3><p>From the p in “plan”, i then “A ” then Esc makes “A plan”. From the a in “plam”, press l to move onto the m, then rn to fix the last letter. Check the mode label before you type.</p><h4>Worked text</h4><pre class=\"lesson-example\">const message = \"plan\";</pre><h4>After the edit</h4><pre class=\"lesson-example\">const message = \"A plan\";</pre><p>Use Start over to try again.</p>","teaches":["insert","char-delete"],"introduces":["i","Esc","h","j","k","l","x","r"],"constraints":[],"drills":[{"task":"<code>request</code> returns a promise, so <code>order.status</code> is always undefined. Add <code>await </code> before <code>request</code>.","hint":"Move down with j. i starts typing before the cursor, and Esc takes you back to Normal mode.","mode":"jsx","start":"import { request } from \"./http.js\";\n\n// Cancels an order that hasn't shipped yet.\nexport async function cancelOrder(id) {\n  const order = request(`/orders/${id}/cancel`, { method: \"POST\" });\n  return order.status;\n}","startCursor":{"line":3,"ch":16},"paths":[{"keys":["j","i","await ","<Esc>"],"tier":"idiomatic","technique":"insert","core":["insert","hjkl"],"note":"j keeps your column, so you land where the new word goes. i types before the cursor."}],"target":"import { request } from \"./http.js\";\n\n// Cancels an order that hasn't shipped yet.\nexport async function cancelOrder(id) {\n  const order = await request(`/orders/${id}/cancel`, { method: \"POST\" });\n  return order.status;\n}","language":"javascript","evidence":"guided","canonicalKey":"foundation.1#0","canonicalFingerprint":"1dqv0zz"},{"task":"Fix the typo in <code>Continnue shopping</code>.","hint":"j moves down a line and l one character right. x deletes the character under the cursor.","mode":"jsx","start":"// The text on the cart page.\nexport const cart = {\n  title: \"Your cart\",\n  empty: \"Nothing in here yet\",\n  continue: \"Continnue shopping\",\n  checkout: \"Go to checkout\",\n  remove: \"Take it out\",\n};","startCursor":{"line":3,"ch":17},"paths":[{"keys":["j","l","x"],"tier":"idiomatic","technique":"char-delete","core":["char-delete","hjkl"],"note":"x deletes one character. Either of the two letters will do."}],"target":"// The text on the cart page.\nexport const cart = {\n  title: \"Your cart\",\n  empty: \"Nothing in here yet\",\n  continue: \"Continue shopping\",\n  checkout: \"Go to checkout\",\n  remove: \"Take it out\",\n};","language":"javascript","evidence":"guided","canonicalKey":"foundation.1#1","canonicalFingerprint":"19tktn"},{"task":"The API drops a request now and then. Let the client retry <code>5</code> times instead of <code>3</code>.","hint":"k moves up a line and h one character left. r and a digit replace the one under the cursor.","mode":"jsx","start":"// Settings for the HTTP client.\nexport const httpConfig = {\n  baseUrl: \"https://api.northwind.shop/v2\",\n  retries: 3,\n  timeout: 4000,\n  debug: false,\n};","startCursor":{"line":4,"ch":15},"paths":[{"keys":["k","h","r","5"],"tier":"idiomatic","technique":"Single-character replacement","core":["hjkl"],"note":"r replaces one character, and you stay in Normal mode."}],"target":"// Settings for the HTTP client.\nexport const httpConfig = {\n  baseUrl: \"https://api.northwind.shop/v2\",\n  retries: 5,\n  timeout: 4000,\n  debug: false,\n};","language":"javascript","evidence":"guided","canonicalKey":"foundation.1#2","canonicalFingerprint":"c6y9mr"}]},"python":{"id":"foundation.1","title":"First edits and modes","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Switch into Insert mode and back, then move to a letter and fix it.</p><p><strong>Before this lesson:</strong> Start here: Your first Vim edit.</p><p>In Normal mode your keys are commands, and in Insert mode they type text. i starts typing before the cursor and Esc takes you back to Normal mode. h, j, k and l move left, down, up and right. x deletes the character under the cursor. r followed by a character replaces just that one character, and you stay in Normal mode.</p><div class=\"pkeys\"><kbd>i</kbd> <kbd>Esc</kbd> <kbd>h</kbd> <kbd>j</kbd> <kbd>k</kbd> <kbd>l</kbd> <kbd>x</kbd> <kbd>r</kbd></div><h3>Example</h3><p>From the p in “plan”, i then “A ” then Esc makes “A plan”. From the a in “plam”, press l to move onto the m, then rn to fix the last letter. Check the mode label before you type.</p><h4>Worked text</h4><pre class=\"lesson-example\">message = \"plan\"</pre><h4>After the edit</h4><pre class=\"lesson-example\">message = \"A plan\"</pre><p>Use Start over to try again.</p>","teaches":["insert","char-delete"],"introduces":["i","Esc","h","j","k","l","x","r"],"constraints":[],"drills":[{"task":"<code>client.post</code> is a coroutine, so <code>response</code> is never the response. Add <code>await </code> before <code>client</code>.","hint":"Move down with j. i starts typing before the cursor, and Esc takes you back to Normal mode.","mode":"python","start":"from shop.integrations.http import client\n\n\nasync def cancel_order(order_id):\n    \"\"\"Cancels an order that hasn't shipped yet.\"\"\"\n    response = client.post(f\"/orders/{order_id}/cancel\")\n    return response.json()[\"status\"]","startCursor":{"line":4,"ch":15},"paths":[{"keys":["j","i","await ","<Esc>"],"tier":"idiomatic","technique":"insert","core":["insert","hjkl"],"note":"j keeps your column, so you land where the new word goes. i types before the cursor."}],"target":"from shop.integrations.http import client\n\n\nasync def cancel_order(order_id):\n    \"\"\"Cancels an order that hasn't shipped yet.\"\"\"\n    response = await client.post(f\"/orders/{order_id}/cancel\")\n    return response.json()[\"status\"]","language":"python","evidence":"guided","canonicalKey":"foundation.1#0","canonicalFingerprint":"1dqv0zz"},{"task":"Fix the typo in <code>Continnue shopping</code>.","hint":"j moves down a line and l one character right. x deletes the character under the cursor.","mode":"python","start":"\"\"\"The text on the cart page.\"\"\"\n\nCART_TITLE = \"Your cart\"\nCART_EMPTY = \"Nothing in here yet\"\nCONTINUE = \"Continnue shopping\"\nCHECKOUT = \"Go to checkout\"\nREMOVE = \"Take it out\"","startCursor":{"line":3,"ch":16},"paths":[{"keys":["j","l","x"],"tier":"idiomatic","technique":"char-delete","core":["char-delete","hjkl"],"note":"x deletes one character. Either of the two letters will do."}],"target":"\"\"\"The text on the cart page.\"\"\"\n\nCART_TITLE = \"Your cart\"\nCART_EMPTY = \"Nothing in here yet\"\nCONTINUE = \"Continue shopping\"\nCHECKOUT = \"Go to checkout\"\nREMOVE = \"Take it out\"","language":"python","evidence":"guided","canonicalKey":"foundation.1#1","canonicalFingerprint":"19tktn"},{"task":"The API drops a request now and then. Let the client retry <code>5</code> times instead of <code>3</code>.","hint":"k moves up a line and h one character left. r and a digit replace the one under the cursor.","mode":"python","start":"\"\"\"Settings for the HTTP client.\"\"\"\n\nAPI_BASE_URL = \"https://api.northwind.shop/v2\"\nAPI_RETRIES = 3\nAPI_TIMEOUT = 4.0\nAPI_DEBUG = False","startCursor":{"line":4,"ch":16},"paths":[{"keys":["k","r","5"],"tier":"idiomatic","technique":"Single-character replacement","core":["hjkl"],"note":"r replaces one character, and you stay in Normal mode."}],"target":"\"\"\"Settings for the HTTP client.\"\"\"\n\nAPI_BASE_URL = \"https://api.northwind.shop/v2\"\nAPI_RETRIES = 5\nAPI_TIMEOUT = 4.0\nAPI_DEBUG = False","language":"python","evidence":"guided","canonicalKey":"foundation.1#2","canonicalFingerprint":"c6y9mr"}]},"text":{"id":"foundation.1","title":"First edits and modes","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Switch into Insert mode and back, then move to a letter and fix it.</p><p><strong>Before this lesson:</strong> Start here: Your first Vim edit.</p><p>In Normal mode your keys are commands, and in Insert mode they type text. i starts typing before the cursor and Esc takes you back to Normal mode. h, j, k and l move left, down, up and right. x deletes the character under the cursor. r followed by a character replaces just that one character, and you stay in Normal mode.</p><div class=\"pkeys\"><kbd>i</kbd> <kbd>Esc</kbd> <kbd>h</kbd> <kbd>j</kbd> <kbd>k</kbd> <kbd>l</kbd> <kbd>x</kbd> <kbd>r</kbd></div><h3>Example</h3><p>From the p in “plan”, i then “A ” then Esc makes “A plan”. From the a in “plam”, press l to move onto the m, then rn to fix the last letter. Check the mode label before you type.</p><h4>Worked text</h4><pre class=\"lesson-example\">Message: plan</pre><h4>After the edit</h4><pre class=\"lesson-example\">Message: A plan</pre><p>Use Start over to try again.</p>","teaches":["insert","char-delete"],"introduces":["i","Esc","h","j","k","l","x","r"],"constraints":[],"drills":[{"task":"Add <code>on </code> before <code>Thursday</code>.","hint":"Move up with k. i starts typing before the cursor, and Esc takes you back to Normal mode.","mode":"text/plain","start":"Subject: Your delivery is booked\n\nHi Dana,\n\nYour order 1042 will arrive Thursday, between 9:00 and 13:00.\nReply to this email if you won't be home.","startCursor":{"line":5,"ch":28},"paths":[{"keys":["k","i","on ","<Esc>"],"tier":"idiomatic","technique":"insert","core":["insert","hjkl"],"note":"k keeps your column, so you land where the new word goes. i types before the cursor."}],"target":"Subject: Your delivery is booked\n\nHi Dana,\n\nYour order 1042 will arrive on Thursday, between 9:00 and 13:00.\nReply to this email if you won't be home.","language":"text","evidence":"guided","canonicalKey":"foundation.1#0","canonicalFingerprint":"1dqv0zz"},{"task":"Fix the typo in <code>dayss</code>.","hint":"j moves down a line and l one character right. x deletes the character under the cursor.","mode":"text/plain","start":"# Returns\n\nYou can send anything back within 30 days of delivery.\nPrint the label from your account and drop the parcel at any post office.\nRefunds reach your card within five working dayss.\nItems on sale can be returned too.","startCursor":{"line":5,"ch":0},"paths":[{"keys":["k","$","h","x"],"tier":"idiomatic","technique":"char-delete","core":["char-delete","hjkl"],"note":"x deletes one character. Either of the two letters will do."}],"target":"# Returns\n\nYou can send anything back within 30 days of delivery.\nPrint the label from your account and drop the parcel at any post office.\nRefunds reach your card within five working days.\nItems on sale can be returned too.","language":"text","evidence":"guided","canonicalKey":"foundation.1#1","canonicalFingerprint":"19tktn"},{"task":"The storefront uses port 3000. Set <code>PORT</code> to <code>3001</code>.","hint":"k moves up a line and h one character left. r and a digit replace the one under the cursor.","mode":"text/plain","start":"# Copy this file to .env and fill in your own keys.\nDATABASE_URL=postgres://shop:shop@localhost:5433/northwind\nREDIS_URL=redis://127.0.0.1:6380/0\nPORT=3000\nMAIL_FROM=orders@northwind.shop\nLOG_LEVEL=info","startCursor":{"line":4,"ch":8},"paths":[{"keys":["k","r","1"],"tier":"idiomatic","technique":"Single-character replacement","core":["hjkl"],"note":"r replaces one character, and you stay in Normal mode."}],"target":"# Copy this file to .env and fill in your own keys.\nDATABASE_URL=postgres://shop:shop@localhost:5433/northwind\nREDIS_URL=redis://127.0.0.1:6380/0\nPORT=3001\nMAIL_FROM=orders@northwind.shop\nLOG_LEVEL=info","language":"text","evidence":"guided","canonicalKey":"foundation.1#2","canonicalFingerprint":"c6y9mr"}]}},"concepts":{"javascript":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Start here: Your first Vim edit.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Switch into Insert mode and back, then move to a letter and fix it.</p><p>In Normal mode your keys are commands, and in Insert mode they type text. i starts typing before the cursor and Esc takes you back to Normal mode. h, j, k and l move left, down, up and right. x deletes the character under the cursor. r followed by a character replaces just that one character, and you stay in Normal mode.</p><h2 class=\"prose-subhead\">Example</h2><p>From the p in “plan”, i then “A ” then Esc makes “A plan”. From the a in “plam”, press l to move onto the m, then rn to fix the last letter. Check the mode label before you type.</p><p>Use Start over to try again.</p></div></details>"},"python":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Start here: Your first Vim edit.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Switch into Insert mode and back, then move to a letter and fix it.</p><p>In Normal mode your keys are commands, and in Insert mode they type text. i starts typing before the cursor and Esc takes you back to Normal mode. h, j, k and l move left, down, up and right. x deletes the character under the cursor. r followed by a character replaces just that one character, and you stay in Normal mode.</p><h2 class=\"prose-subhead\">Example</h2><p>From the p in “plan”, i then “A ” then Esc makes “A plan”. From the a in “plam”, press l to move onto the m, then rn to fix the last letter. Check the mode label before you type.</p><p>Use Start over to try again.</p></div></details>"},"text":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Start here: Your first Vim edit.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Switch into Insert mode and back, then move to a letter and fix it.</p><p>In Normal mode your keys are commands, and in Insert mode they type text. i starts typing before the cursor and Esc takes you back to Normal mode. h, j, k and l move left, down, up and right. x deletes the character under the cursor. r followed by a character replaces just that one character, and you stay in Normal mode.</p><h2 class=\"prose-subhead\">Example</h2><p>From the p in “plan”, i then “A ” then Esc makes “A plan”. From the a in “plam”, press l to move onto the m, then rn to fix the last letter. Check the mode label before you type.</p><p>Use Start over to try again.</p></div></details>"}}}