There’s no shortcut I'm aware of, but Vim does have a feature that allows you to move a visual selection. It's not useful for the specific use-case described, but it might be for moves of larger selections.
The output of :help V
explains:
With [count]
select the same number of lines as used for the last Visual operation, but at the current cursor position, multiplied by [count]
.
So you can move a linewise visual selection with the following sequence:
- Pressing y to perform a “Visual operation”,
- Using whichever of Vim’s motions are the most convenient/efficient to move the cursor to the first line of the location where you want the selection to be moved to.
- Pressing 1V to re-enter Visual mode with the same number of lines selected.
This obviously stores the previously selected text in the yank and unnamed registers. If this is not desirable, you can prevent it by using "_y to yank into the black hole register instead.
The other commands to enter visual mode also take counts, so you can use this technique for characterwise or blockwise selections, too.
j
you can easily just reselect only the current line via<esc>V
or justVV
v
once, then move to the desired location (j
,k
etc.), then hitv
again - this starts the selection, on the line I want ... also, you can create Vimium mappings (click Icon, selectOptions
).