Edit a rectangle

0 of 1

The technique

Your textVim mode: Normal
Put - in front of all three lines. Before: one / two / three. After: - one / - two / - three.

The text appears on every selected line when you press Esc.

Keys in this lesson

Ctrl-v
Select a block of columns.
Ctrl-v…I
Type at the left edge of every selected line, then Esc.
Ctrl-v…$A
Type at the end of every selected line, then Esc.

Before this lesson: Visual selection; insertion.

More about this lesson

Apply a column edit and understand when Escape commits it.

Ctrl-v selects a rectangle. I inserts a prefix across its selected lines after Esc; A appends to its right edge. Within a block, $ then A handles each selected line’s actual end. Unequal lengths matter. If the browser intercepts Ctrl-v, use Keyboard check; do not assume native and browser shortcuts are identical.

Example

Select the first column of three notes with Ctrl-v then 2j. I, type a bullet and a space, then Esc adds the prefix to all selected lines.

Use Reset to try again.

Guides on this topic

Exercise 1 of 1

0keys

par 8

Prefix all three notes with the shown marker.

Your textVim mode: Normal

Desired result

// // first note
// // a longer note
// // last note

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.