Vim Scoops / Lessons / Select text

How to select text in Vim

Press v to start selecting, move the cursor to stretch the selection, then press d to delete, y to copy or c to change it. V selects whole lines.

The keys

KeysWhat they do
vSelect characters
VSelect whole lines
Ctrl+vSelect a block (columns)
oJump to the other end of the selection
EscCancel the selection

Any motion works while selecting: w, $, f,, even a search. That's often the easiest way to see what you're about to change before you change it.

Press : with lines selected and Vim fills in '<,'>, so a command like :s only touches those lines.

Related

Want all of Vim, in order? Vim Scoops is a free game that starts at h j k l and builds up to macros.

Play the full game