Choose the whole pair

0 of 6

The technique

Your textVim mode: Normal
Replace the argument and keep the brackets. Before: save(draft);. After: save(ready);.

ca( would replace the brackets as well. Start inside the pair you mean.

Keys in this lesson

ci(
Change the text inside round brackets.
ca(
Change the brackets and what they hold.
ci[
Change inside square brackets.
ci{
Change inside curly brackets.
ci'
Change inside single quotes.

Before this lesson: Words and quotations.

More about this lesson

Replace contents or delimiters deliberately; start inside the intended region.

i keeps the surrounding pair; a includes it. ci( changes arguments while ca( replaces the parentheses too. Bracket objects can span lines and select an inner nested pair. Start inside the intended region: this browser and native Vim can differ when you start before a call. Single-quoted objects stay within the intended quotation.

Example

From inside (draft), ci( then ready then Esc gives (ready); ca( then ready gives ready. Those are different desired results.

Use Reset to try again.

Guides on this topic

Exercise 1 of 6

0keys

par 13

Replace only the selected pair’s contents as shown. Keep its delimiters, any outer pair and the archive.

Your textVim mode: Normal

Desired result

const result = ("current");
// Keep the archive unchanged.

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.