Optional: markup objects

0 of 2

The technique

Your textVim mode: Normal
Change the emphasised word and keep its tags. Before: <p><em>draft</em></p>. After: <p><em>final</em></p>.

cit uses the innermost element around the cursor, here em. cat would replace <em>draft</em> as a whole.

Keys in this lesson

cit
Change inside an HTML element.
cat
Change the element, tags included.

Before this lesson: Paired objects.

More about this lesson

Edit the inside of an element or remove its tags deliberately.

These are HTML fragments in every example-language setting. it names an element’s contents; at includes its opening and closing tags. Start inside the intended element. Nested elements make the intended pair important; markup practice is optional.

Example

From inside <em>draft</em>, cit then final then Esc keeps the em tags. cat replaces the whole element.

Use Reset to try again.

Guides on this topic

Exercise 1 of 2

0keys

par 12

In this optional HTML fragment, replace the intended element as shown. Preserve the outer structure and archive.

Your textVim mode: Normal

Desired result

<section><p><em>new note</em></p><p>Keep archive</p></section>

Yours

Par

Keyboard shortcuts
Ctrl+Enter
Check the result
Ctrl+Alt+U
Undo the last change
Ctrl+Alt+H
Show the next hint
Ctrl+Alt+R
Reset the exercise
Ctrl+Alt+P
Previous exercise
Ctrl+Alt+N
Next exercise
Enter
After a solve: the next step

Ctrl+Alt shortcuts leave Vim's own keys alone. On a Mac, Control and Option.