Vim Recall繁體中文

Insert before a Visual block

I

Example

Visual block 0 / 3
one
two
Cursor on line 2, column 1 · Block selection

Insert the same prefix on selected block lines.

Before & after
Before
one
two
Cursor on line 2, column 1 · Block selection
After
//one
//two
Cursor on line 1, column 1

Start in Visual mode. Start with a block selection covering column one of both lines. Type I//, then Esc. The repeated insert appears when you leave Insert mode.

Details & Vim help

Example replayed in Vim

Insert the same prefix on selected block lines.

In blockwise Visual mode, press I, type the prefix, then Esc. Vim repeats the insertion on the other selected lines; lines too short for the block have special handling.