{"schemaVersion":1,"contentVersion":"3.4.0","id":"foundation.2","languages":{"javascript":{"id":"foundation.2","title":"Recover and cancel","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Undo a complete change, redo it, and cancel a pending command without damaging text.</p><p><strong>Before this lesson:</strong> First edits and modes.</p><p>u undoes one change in Normal mode. Ctrl-r redoes an undone change; it is different from the platform Reset shortcut. Esc cancels a pending operator such as d and leaves Insert mode. After undo or redo, recheck the cursor position; 0 reaches the line start. A number before l moves that many characters right; 3l is three steps. Reset restores this drill’s starting state and starts a new attempt; it does not undo your saved course progress.</p><div class=\"pkeys\"><kbd>u</kbd> <kbd>Ctrl-r</kbd> <kbd>Esc</kbd> <kbd>0</kbd> <kbd>3l</kbd></div><h3>Example</h3><p>If you insert “wrong ” before “note”, Esc then u removes the whole insertion. Ctrl-r brings it back. To abandon a pending d before giving it a motion, press Esc. Then make the edit you intended.</p><h4>Worked text</h4><pre class=\"lesson-example\">const message = \"note\";</pre><h4>Before undo</h4><pre class=\"lesson-example\">const message = \"wrong note\";</pre><p>Use Reset to try again.</p>","teaches":["undo"],"introduces":["u","<C-r>","d","0","count"],"constraints":[],"drills":[{"task":"Try a mistaken insertion, undo it, then add “Careful ” before Calm.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"jsx","start":"const message = \"Calm work\";","startCursor":{"line":0,"ch":17},"paths":[{"keys":["i","wrong ","<Esc>","u","i","Careful ","<Esc>"],"tier":"idiomatic","technique":"undo","core":["undo"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"const message = \"Careful Calm work\";","language":"javascript","evidence":"guided","canonicalKey":"foundation.2#0","canonicalFingerprint":"f3sxxr"},{"task":"Insert “Carefull ” before Calm; undo and redo it, then remove the extra l.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"jsx","start":"const message = \"Calm work\";","startCursor":{"line":0,"ch":17},"paths":[{"keys":["i","Carefull ","<Esc>","u","<C-r>","0","2","4","l","x"],"tier":"idiomatic","technique":"undo","core":["undo"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"const message = \"Careful Calm work\";","language":"javascript","evidence":"guided","canonicalKey":"foundation.2#1","canonicalFingerprint":"f3sxxr"},{"task":"Start d, cancel with Escape, then add “Careful ” before Calm.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"jsx","start":"const message = \"Calm work\";","startCursor":{"line":0,"ch":17},"paths":[{"keys":["d","<Esc>","i","Careful ","<Esc>"],"tier":"idiomatic","technique":"insert","core":["insert"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"const message = \"Careful Calm work\";","language":"javascript","evidence":"guided","canonicalKey":"foundation.2#2","canonicalFingerprint":"f3sxxr"}]},"python":{"id":"foundation.2","title":"Recover and cancel","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Undo a complete change, redo it, and cancel a pending command without damaging text.</p><p><strong>Before this lesson:</strong> First edits and modes.</p><p>u undoes one change in Normal mode. Ctrl-r redoes an undone change; it is different from the platform Reset shortcut. Esc cancels a pending operator such as d and leaves Insert mode. After undo or redo, recheck the cursor position; 0 reaches the line start. A number before l moves that many characters right; 3l is three steps. Reset restores this drill’s starting state and starts a new attempt; it does not undo your saved course progress.</p><div class=\"pkeys\"><kbd>u</kbd> <kbd>Ctrl-r</kbd> <kbd>Esc</kbd> <kbd>0</kbd> <kbd>3l</kbd></div><h3>Example</h3><p>If you insert “wrong ” before “note”, Esc then u removes the whole insertion. Ctrl-r brings it back. To abandon a pending d before giving it a motion, press Esc. Then make the edit you intended.</p><h4>Worked text</h4><pre class=\"lesson-example\">message = \"note\"</pre><h4>Before undo</h4><pre class=\"lesson-example\">message = \"wrong note\"</pre><p>Use Reset to try again.</p>","teaches":["undo"],"introduces":["u","<C-r>","d","0","count"],"constraints":[],"drills":[{"task":"Try a mistaken insertion, undo it, then add “Careful ” before Calm.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"python","start":"message = \"Calm work\"","startCursor":{"line":0,"ch":11},"paths":[{"keys":["i","wrong ","<Esc>","u","i","Careful ","<Esc>"],"tier":"idiomatic","technique":"undo","core":["undo"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"message = \"Careful Calm work\"","language":"python","evidence":"guided","canonicalKey":"foundation.2#0","canonicalFingerprint":"f3sxxr"},{"task":"Insert “Carefull ” before Calm; undo and redo it, then remove the extra l.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"python","start":"message = \"Calm work\"","startCursor":{"line":0,"ch":11},"paths":[{"keys":["i","Carefull ","<Esc>","u","<C-r>","0","1","8","l","x"],"tier":"idiomatic","technique":"undo","core":["undo"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"message = \"Careful Calm work\"","language":"python","evidence":"guided","canonicalKey":"foundation.2#1","canonicalFingerprint":"f3sxxr"},{"task":"Start d, cancel with Escape, then add “Careful ” before Calm.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"python","start":"message = \"Calm work\"","startCursor":{"line":0,"ch":11},"paths":[{"keys":["d","<Esc>","i","Careful ","<Esc>"],"tier":"idiomatic","technique":"insert","core":["insert"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"message = \"Careful Calm work\"","language":"python","evidence":"guided","canonicalKey":"foundation.2#2","canonicalFingerprint":"f3sxxr"}]},"text":{"id":"foundation.2","title":"Recover and cancel","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Undo a complete change, redo it, and cancel a pending command without damaging text.</p><p><strong>Before this lesson:</strong> First edits and modes.</p><p>u undoes one change in Normal mode. Ctrl-r redoes an undone change; it is different from the platform Reset shortcut. Esc cancels a pending operator such as d and leaves Insert mode. After undo or redo, recheck the cursor position; 0 reaches the line start. A number before l moves that many characters right; 3l is three steps. Reset restores this drill’s starting state and starts a new attempt; it does not undo your saved course progress.</p><div class=\"pkeys\"><kbd>u</kbd> <kbd>Ctrl-r</kbd> <kbd>Esc</kbd> <kbd>0</kbd> <kbd>3l</kbd></div><h3>Example</h3><p>If you insert “wrong ” before “note”, Esc then u removes the whole insertion. Ctrl-r brings it back. To abandon a pending d before giving it a motion, press Esc. Then make the edit you intended.</p><h4>Worked text</h4><pre class=\"lesson-example\">Message: note</pre><h4>Before undo</h4><pre class=\"lesson-example\">Message: wrong note</pre><p>Use Reset to try again.</p>","teaches":["undo"],"introduces":["u","<C-r>","d","0","count"],"constraints":[],"drills":[{"task":"Try a mistaken insertion, undo it, then add “Careful ” before Calm.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"text/plain","start":"Message: Calm work","startCursor":{"line":0,"ch":9},"paths":[{"keys":["i","wrong ","<Esc>","u","i","Careful ","<Esc>"],"tier":"idiomatic","technique":"undo","core":["undo"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"Message: Careful Calm work","language":"text","evidence":"guided","canonicalKey":"foundation.2#0","canonicalFingerprint":"f3sxxr"},{"task":"Insert “Carefull ” before Calm; undo and redo it, then remove the extra l.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"text/plain","start":"Message: Calm work","startCursor":{"line":0,"ch":9},"paths":[{"keys":["i","Carefull ","<Esc>","u","<C-r>","0","1","6","l","x"],"tier":"idiomatic","technique":"undo","core":["undo"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"Message: Careful Calm work","language":"text","evidence":"guided","canonicalKey":"foundation.2#1","canonicalFingerprint":"f3sxxr"},{"task":"Start d, cancel with Escape, then add “Careful ” before Calm.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"text/plain","start":"Message: Calm work","startCursor":{"line":0,"ch":9},"paths":[{"keys":["d","<Esc>","i","Careful ","<Esc>"],"tier":"idiomatic","technique":"insert","core":["insert"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"Message: Careful Calm work","language":"text","evidence":"guided","canonicalKey":"foundation.2#2","canonicalFingerprint":"f3sxxr"}]}}}