gv โ€” Re-Select

Bring back the last visual selection.

Keys: gv

gv re-enters Visual mode with the same selection you last had โ€” same shape, same endpoints. Essential for re-applying an operator to the same region.

gv โ€” Re-Select

gv re-enters Visual mode with the exact same selection you last had โ€” same shape, same lines, same characters.

Re-indent without re-selecting
KeyNote
V5jSelect 6 lines
>Indent โ€” selection lost
gvBring it back
>Indent again
gv>Or just gv> repeatedly

Worked example โ€” gv

Re-select the previous visual region.

Step 1 ยท
visual.gv
Step 2 ยท vw ยท Selected 'dolor '.
Selected 'dolor '.
Step 3 ยท U ยท U โ€” uppercased the selection.
U โ€” uppercased the selection.
Step 4 ยท gv ยท gv โ€” same region selected again.
gv โ€” same region selected again.

gv is great for chained visual operations.

โ–ถ Try this in the simulator

Watch

See also: Visual + Ex Range, Operators on Visual Selections