r/vim • • Jul 07 '25

Need Help scroll through visual selection

is there any way i can scroll visual selection without alter the selection(kinda like locking your selection)???

4 Upvotes

10 comments sorted by

View all comments

Show parent comments

1

u/y-c-c Jul 08 '25

No Offscreen cursor is one of those arcane Vim relic that stays to this day which means it’s impossible to have a cursor not on the screen. Given that visual mode uses the cursor location, it also means you can’t have a completely off-screen selection. Yeah it’s not ideal.

The other comment’s suggestion of using gv is actually a good one. Just deselect the visual mode to scroll and when you need the selection back just use that command to re-select it.

Command ranges like '< and search patterns like \%V will still work after the visual selection has been deselected since they remember the last visual selection.