Step 1 of 8

Many cursors, one command

Many cursors, one command

In lesson 1 we said a Helix selection can hold more than one cursor. This lesson is about how you get those cursors, and what you can do once you have them.

The idea is simple. Every command you already know acts on the selection. If the selection is made of several ranges, the command runs on every one of them, at the same time. Insert some text and it appears in each place; delete and each range disappears; move with w and every cursor moves a word.

The simplest way to get a second cursor is to copy the one you have onto the line below:

  • C copies the selection to the next line
  • Alt-C copies it to the previous line instead

The statusline keeps count: with three cursors it reads 3 sels. One of them is the primary selection — drawn a little brighter — and that’s the one commands like search keep their attention on.

When you’re done, , collapses everything down to the primary cursor. You’ll use it constantly, so work through the checklist below and get it into your fingers now.

  1. Add a cursor on the line below with C From the first line, a second cursor appears on the line below when you press C.
  2. Add a third cursor with C The statusline reads 3 sels once you press C again.
  3. Type with every cursor at once Type a few characters into all three lines at once after you press i.
  4. Escape, then collapse back to one cursor with , Hit Escape for normal mode first — only the primary cursor stays once you press ,.
Add a cursor on the line below with C From the first line, a second cursor appears on the line below when you press C.

Next: Add a third cursor with C

Loading editor…