How do I move to the diagonally opposite corner of a blockwise visual selection?
Answer
O (visual-block)
Explanation
In Visual-Block mode (<C-v>), pressing O moves the cursor to the diagonally opposite corner of the rectangular selection. This lets you adjust both the row and column extent of the block at once — unlike o, which only toggles between the two ends on the same column.
How it works
o— in any visual mode, moves the cursor to the other end of the selection (same column for block; opposite line end for linewise; opposite end for charwise)O— only in Visual-Block: moves to the opposite corner diagonally, so cursor jumps from (top-left ↔ bottom-right) or (top-right ↔ bottom-left)
A block selection has four corners. o toggles between two corners on the same row edge. O toggles to the corner on the opposite column edge, giving you independent control over all four corners.
Example
Start a block selection from column 3 to column 8, rows 1–4:
[ cursor at top-left corner ]
foo |bar| baz
foo |bar| baz
foo |bar| baz
foo |bar| baz
- Press
o→ cursor jumps to bottom-left corner (same column, different row) - Press
O→ cursor jumps to top-right corner (different column, same row)
This lets you reshape the block from any of its four corners without restarting the selection.
Tips
- Use
Oto quickly extend or shrink the column span of a block selection - Combine with
oto navigate all four corners: eachoandOpress gives you a different anchor point - Practical use: select a block of code, press
Oto reposition to the right edge, then extend rightward withl