Recover the previous selection
gv
Example
Normal mode. Selected lines 1–3 with V2j, then canceled with Escape.
Before
Previous selection: lines 1–3
Now: selection canceled · Normal mode
- gv Lines 1–3 selected · Visual Line mode
After
Selection: lines 1–3 again
Mode: Visual Line
Details & Vim help
Re-enter Visual mode with the previous selection’s area and mode.
Apply a second operation without selecting a passage again.
While already in Visual mode, gv exchanges the current and previous selections. Intervening edits can alter the area.
gv restores the previous selection. It does not recover deleted text.
Try it in Vim
- Select text and leave Visual mode with <Esc>.
- Press gv in Normal mode.
- Apply the next operator, or adjust the restored selection.