vimtricks.wiki Concise Vim tricks, one at a time.

How do I switch between character, line, and block visual selection without reselecting?

Answer

v / V / <C-v> (while in visual mode)

Explanation

When you are already in visual mode and realize you need a different selection type, you do not have to exit and re-enter. Pressing v, V, or <C-v> while already in visual mode switches between character-wise, line-wise, and block-wise selection, preserving your current selection boundaries.

How it works

  • In visual character mode (v): press V to switch to line-wise, or <C-v> to switch to block-wise
  • In visual line mode (V): press v to switch to character-wise, or <C-v> to switch to block-wise
  • In visual block mode (<C-v>): press v to switch to character-wise, or V to switch to line-wise
  • The anchor point and cursor position stay the same — only the selection shape changes
  • Pressing the same key as your current mode exits visual mode (e.g., v in character visual exits)

Example

You start selecting text in character-wise visual mode:

first line of [selected text
second line of selected] text

Press V to switch to line-wise — both entire lines are now selected:

[first line of selected text
second line of selected text]

Press <C-v> to switch to block-wise — a rectangular column is selected instead.

Tips

  • This is especially useful when you realize mid-selection that you need line-wise for > indentation or block-wise for column editing
  • Works seamlessly with gv — if you reselect with gv, you can then switch the mode type

Next

How do I ignore whitespace changes when using Vim's diff mode?