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
| Keys | What they do |
|---|---|
| v | Select characters |
| V | Select whole lines |
| Ctrl+v | Select a block (columns) |
| o | Jump to the other end of the selection |
| Esc | Cancel 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