Vim Recall繁體中文

Restore the previous selection

gv

Example

Normal 0 / 1
one two
three four
five six
Cursor on line 1, column 3

Reselect the last Visual area.

Before & after
Before
one two
three four
five six
Cursor on line 1, column 3
After
one two
three four
five six
Cursor on line 1, column 3 · Character selection

Start in Normal mode. Before the displayed initial state, start on the first character and use vll then Esc to prepare the first three characters as a prior Visual area. The displayed Before cursor is on the third character after that preparation. gv reselects the recorded area.

Details & Vim help

Example replayed in Vim

Reselect the last Visual area.

gv starts Visual mode using the previous selection and its selection type. After an operator exits Visual mode, this lets you apply another operator to that area.