Step 4 of 7

5. Visual Mode

What can I do with visual mode?

We’ve now learned how to use the different variants of visual mode to select a region of text. But what can we actually do with it? So far we’ve only deleted regions of text — but there’s more we can do.

You can use the following key maps in visual mode:

  • x or d to delete
  • c to change — i.e. deleting your entire selection, then dropping you into insert mode
  • y to “yank” — this is similar to copying to the clipboard, and we’ll learn more about this in the next lesson
  • > to indent forward
  • < to indent backwards

Work through the checklist below. Don’t feel like you need to try yanking for now, though; we’re going to learn about that soon.

  1. Select some words, then delete them with d Press v on the first practice line, extend over a few words, then hit d.
  2. Change a selection with c Select some words on the second practice line, then press c.
  3. Drop back to normal mode Type a replacement for the words you changed, then hit Escape.
  4. Indent some lines with > Select a few lines of the last paragraph with V, then press >.
Select some words, then delete them with d Press v on the first practice line, extend over a few words, then hit d.

Next: Change a selection with c

Loading editor…