Edit a rectangle
The technique
The text appears on every selected line when you press Esc. gv then $A would add text to the end of the same lines.
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 and insertion.
More about this lesson
Edit a column of text on several lines at once. The change shows up when you press Esc.
Ctrl-v selects a rectangle. I types at its left edge and A at its right edge, and the text appears on every line when you press Esc. Press $ before A to add text at the real end of each line, even when the lines are different lengths. gv selects the same block again, so you can add to the start and then the end. If your browser takes over Ctrl-v, use Keyboard check.
Example
Select the first column of three notes with Ctrl-v then 2j. Press I, type a bullet and a space, then press Esc to add them to all three lines.
Use Start over to try again.
Guides on this topic
Exercise 1 of 1
0keys
par 21The four lines run together as one paragraph. Make each of them a list item, <li> at the start and </li> at the end.
Make it look like this
// Shown under the price on every product page. export function DeliveryInfo() { return ( <ul className="delivery-info"> <li>Free delivery on orders over 50 euros</li> <li>Sent within two working days</li> <li>Free returns for 30 days</li> <li>Pay later with Klarna</li> </ul> ); }