{"schemaVersion":1,"contentVersion":"3.4.0","id":"foundation.8","languages":{"javascript":{"id":"foundation.8","title":"Count a known region","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Use a count when the intended number is clear and protect neighbouring text.</p><p><strong>Before this lesson:</strong> Compose an edit.</p><p>A count before a motion or edit repeats it: 2w, 3x or 2dd. d2w and 2dw both delete two word motions. Count only the intended region. A semantic boundary such as a word or line end is safer when the length is uncertain. One counted edit is one undo step.</p><div class=\"pkeys\"><kbd>2w</kbd> <kbd>3x</kbd> <kbd>2dd</kbd> <kbd>d2w</kbd></div><h3>Example</h3><p>If exactly two obsolete lines sit above “Keep”, 2dd removes both in one edit. If there are three, the same command deliberately leaves one behind. Inspect the region before choosing a count.</p><h4>Worked text</h4><pre class=\"lesson-example\">// Obsolete first\n// Obsolete second\n// Keep</pre><h4>After the edit</h4><pre class=\"lesson-example\">// Keep</pre><p>Use Reset to try again.</p>","teaches":["count"],"introduces":["count"],"constraints":[],"drills":[{"task":"Remove exactly 2 obsolete lines. Keep both neighbouring lines.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"jsx","start":"// Keep archive\n// Obsolete 1\n// Obsolete 2\n// Keep next step","startCursor":{"line":1,"ch":0},"paths":[{"keys":["2","d","d"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"// Keep archive\n// Keep next step","language":"javascript","evidence":"guided","canonicalKey":"foundation.8#0","canonicalFingerprint":"ft22li"},{"task":"Remove the 2 exclamation marks. Keep both words and the space.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"jsx","start":"const message = \"Read!! carefully\";","startCursor":{"line":0,"ch":21},"paths":[{"keys":["2","x"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"const message = \"Read carefully\";","language":"javascript","evidence":"guided","canonicalKey":"foundation.8#1","canonicalFingerprint":"315jl1"},{"task":"Remove the 2 obsolete words before current, with their spaces.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"jsx","start":"const message = \"old extra current report\";","startCursor":{"line":0,"ch":17},"paths":[{"keys":["2","d","w"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"const message = \"current report\";","language":"javascript","evidence":"guided","canonicalKey":"foundation.8#2","canonicalFingerprint":"mk1788"}]},"python":{"id":"foundation.8","title":"Count a known region","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Use a count when the intended number is clear and protect neighbouring text.</p><p><strong>Before this lesson:</strong> Compose an edit.</p><p>A count before a motion or edit repeats it: 2w, 3x or 2dd. d2w and 2dw both delete two word motions. Count only the intended region. A semantic boundary such as a word or line end is safer when the length is uncertain. One counted edit is one undo step.</p><div class=\"pkeys\"><kbd>2w</kbd> <kbd>3x</kbd> <kbd>2dd</kbd> <kbd>d2w</kbd></div><h3>Example</h3><p>If exactly two obsolete lines sit above “Keep”, 2dd removes both in one edit. If there are three, the same command deliberately leaves one behind. Inspect the region before choosing a count.</p><h4>Worked text</h4><pre class=\"lesson-example\"># Obsolete first\n# Obsolete second\n# Keep</pre><h4>After the edit</h4><pre class=\"lesson-example\"># Keep</pre><p>Use Reset to try again.</p>","teaches":["count"],"introduces":["count"],"constraints":[],"drills":[{"task":"Remove exactly 2 obsolete lines. Keep both neighbouring lines.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"python","start":"# Keep archive\n# Obsolete 1\n# Obsolete 2\n# Keep next step","startCursor":{"line":1,"ch":0},"paths":[{"keys":["2","d","d"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"# Keep archive\n# Keep next step","language":"python","evidence":"guided","canonicalKey":"foundation.8#0","canonicalFingerprint":"ft22li"},{"task":"Remove the 2 exclamation marks. Keep both words and the space.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"python","start":"message = \"Read!! carefully\"","startCursor":{"line":0,"ch":15},"paths":[{"keys":["2","x"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"message = \"Read carefully\"","language":"python","evidence":"guided","canonicalKey":"foundation.8#1","canonicalFingerprint":"315jl1"},{"task":"Remove the 2 obsolete words before current, with their spaces.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"python","start":"message = \"old extra current report\"","startCursor":{"line":0,"ch":11},"paths":[{"keys":["2","d","w"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"message = \"current report\"","language":"python","evidence":"guided","canonicalKey":"foundation.8#2","canonicalFingerprint":"mk1788"}]},"text":{"id":"foundation.8","title":"Count a known region","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Use a count when the intended number is clear and protect neighbouring text.</p><p><strong>Before this lesson:</strong> Compose an edit.</p><p>A count before a motion or edit repeats it: 2w, 3x or 2dd. d2w and 2dw both delete two word motions. Count only the intended region. A semantic boundary such as a word or line end is safer when the length is uncertain. One counted edit is one undo step.</p><div class=\"pkeys\"><kbd>2w</kbd> <kbd>3x</kbd> <kbd>2dd</kbd> <kbd>d2w</kbd></div><h3>Example</h3><p>If exactly two obsolete lines sit above “Keep”, 2dd removes both in one edit. If there are three, the same command deliberately leaves one behind. Inspect the region before choosing a count.</p><h4>Worked text</h4><pre class=\"lesson-example\">Obsolete first\nObsolete second\nKeep</pre><h4>After the edit</h4><pre class=\"lesson-example\">Keep</pre><p>Use Reset to try again.</p>","teaches":["count"],"introduces":["count"],"constraints":[],"drills":[{"task":"Remove exactly 2 obsolete lines. Keep both neighbouring lines.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"text/plain","start":"Keep archive\nObsolete 1\nObsolete 2\nKeep next step","startCursor":{"line":1,"ch":0},"paths":[{"keys":["2","d","d"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"Keep archive\nKeep next step","language":"text","evidence":"guided","canonicalKey":"foundation.8#0","canonicalFingerprint":"ft22li"},{"task":"Remove the 2 exclamation marks. Keep both words and the space.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"text/plain","start":"Message: Read!! carefully","startCursor":{"line":0,"ch":13},"paths":[{"keys":["2","x"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"Message: Read carefully","language":"text","evidence":"guided","canonicalKey":"foundation.8#1","canonicalFingerprint":"315jl1"},{"task":"Remove the 2 obsolete words before current, with their spaces.","hint":"Compare the desired result with the starting text. Preserve the surrounding text.","mode":"text/plain","start":"Message: old extra current report","startCursor":{"line":0,"ch":9},"paths":[{"keys":["2","d","w"],"tier":"idiomatic","technique":"count","core":["count"],"note":"Choose the intended boundary, make the change and finish in Normal mode."}],"target":"Message: current report","language":"text","evidence":"guided","canonicalKey":"foundation.8#2","canonicalFingerprint":"mk1788"}]}}}