Visual Mode as a Learning Tool

Use v to see motions, select familiar ranges, and build confidence.

Keys: v, Esc, d, y, c

v enters character-wise visual mode. Motions extend a visible selection, making this a useful bridge from other editors and a way to learn what motions do.

Most editors teach you to select text first and choose an action second. Vim supports that familiar order. Press v in normal mode to enter character-wise visual mode. Move the cursor, and the text between your starting point and the cursor is highlighted. Press d to delete the selection, y to yank it, or c to replace it.

Start a character-wise selection
KeyNote
{key:v}
Select with a word motion, then delete
KeyNote
{key:v}
{key:w}
{key:d}
Character-wise visual mode with v

Make Motions Visible

Visual mode is a useful laboratory for motions. Start a selection with v, try a motion, and watch where the cursor lands. w moves toward the next word, e moves to a word ending, $ reaches the end of the line, and G reaches the end of the file. The highlight makes the direction and scale of each motion visible. Press Esc, return to the starting point, and try another.

Try What the highlight teaches
vw Where the next-word motion lands
ve Where the current or next word ends
v0 and v$ The two ends of the current line
vgg and vG The beginning and end of the file
v/{pattern}Enter How far a search motion travels

The More Vim-Like Order

Selection-first editing is useful, especially while learning, but it is not usually the shortest Vim path. Vim's native grammar puts the operator first and the motion second. Instead of selecting a word and then deleting it, press dw. Instead of selecting the word under the cursor and then copying it, press yiw. Instead of selecting to the end of the line and then replacing it, press c$.

Nothing flashes on the screen before those commands act. You learn to trust the motion. The operator and motion resolve the range together, without creating a visible selection first. This is faster, composes with counts, and records one clean action for the dot command.

Reference

Key Action
v Enter or leave character-wise visual mode
Esc Cancel the selection
d Delete the selection and save it for putting
y Yank the selection
c Delete the selection and enter insert mode

Worked example โ€” v and motion

Character-wise visual selection.

Step 1 ยท
[missing screenshot visual.char/frame_01.color.svg โ€” run python content/render_screenshots.py]
Step 2 ยท vw ยท vw โ€” selected through next word.
[missing screenshot visual.char/frame_02.color.svg โ€” run python content/render_screenshots.py]
Step 3 ยท d ยท d โ€” delete the selection.
[missing screenshot visual.char/frame_03.color.svg โ€” run python content/render_screenshots.py]

Visual mode picks a range first, then you apply an operator. Useful when the right motion is hard to compose.

See also: Word Motions, Line Motions, Line and Block Visual, Operators on Visual Selections, Motion Classification