How do I switch between character, line, and block visual selection without starting over?
Answer
v / V / <C-v> (while in visual mode)
Explanation
While you are already in visual mode, pressing v, V, or <C-v> switches the selection type in place — the selection endpoint stays where it is and only the mode changes. There is no need to press <Esc> and restart the selection from scratch.
How it works
| Key | Effect |
|---|---|
v |
Switch to / stay in charwise visual mode |
V |
Switch to linewise visual mode |
<C-v> |
Switch to blockwise visual mode |
Pressing the key for the current mode exits visual mode entirely (same as <Esc>).
Example
You visually select a few words with v and then realize you need whole lines. Instead of pressing <Esc> and reselecting:
- While in charwise visual mode (
v), pressV - The selection expands to full lines instantly — same start and end positions, just linewise
Or you have a linewise visual selection and want to turn it into a block:
- Press
<C-v>while inVmode - The selection becomes a rectangle — useful before pressing
Ito insert on every line
Tips
- The cursor position is preserved when switching modes, so the selection boundaries stay the same.
- Use
oto toggle the active end of the selection before switching mode to anchor the right corner. - After switching to
<C-v>, use$to extend the block to the end of the longest line.