Vim Recall繁體中文

Adjust a selection from its other end

o or O

Example

Characterwise Visual mode. green blue selected in red green blue. Active cursor on the final e.

Before
Line: red green blue Selected: green blue Active end: final e in blue

  1. o Active end moves to g · green blue still selected
  2. b Extend back to r · red green blue selected

After
After o: active end is g in green After b: selection covers red green blue

Details & Vim help

Swap the active end of a Visual selection so you can refine the opposite edge.

Fix a selection’s start without abandoning its end.

In a Visual block, uppercase O switches to the other corner on the same line. Lowercase o switches to the opposite end. These commands require an active Visual selection.

This example uses characterwise Visual mode. o swaps the active end; the following motion adjusts the selection.

Try it in Vim

  1. Create a Visual selection.
  2. Press lowercase o to move to the opposite end and adjust it.
  3. In blockwise Visual mode, uppercase O switches to the other corner on the same line.