Use the last Visual area, like :'<,'>
:*
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2one two
three four
five six
keepCursor on line 4, column 1one two
three four
five six
keepCursor on line 4, column 1one two
three four
five six
keepCursor on line 2, column 1Use the last Visual area, like :'<,'>.
Local marks
- '.
line 2, column 1- '<
line 1, column 1- '>
line 2, column 1
Command entered · ready to apply
Local marks
- '.
line 2, column 1- '<
line 1, column 1- '>
line 2, column 1
Command applied
Local marks
- '.
line 2, column 1- '<
line 1, column 1- '>
line 2, column 1
Before & after
one two
three four
five six
keepCursor on line 4, column 1Local marks
- '.
line 2, column 1- '<
line 1, column 1- '>
line 2, column 1
one two
three four
five six
keepCursor on line 2, column 1Local marks
- '.
line 2, column 1- '<
line 1, column 1- '>
line 2, column 1
Start in Normal mode. The first two lines were previously selected linewise with ggVj, then Esc ended Visual mode and the cursor moved to line 4. :* uses that remembered Visual line range and moves to its last line.
Details & Vim help
Example replayed in Vim
Use the last Visual area, like :'<,'>. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.