Step 5 of 8

One cursor per line

One cursor per line

A selection that spans several lines is the most common starting point of all, and the most common thing to do with it is to get a cursor on each line. That’s so frequent that it has a key of its own: Alt-s splits the selection on line breaks.

It’s the same as S with a pattern of \n, just shorter. After it you have one selection per line, each covering that line’s text and nothing else — so I puts a cursor at the start of every line, A at the end, and c rewrites each line in place.

This is the Helix answer to a lot of things other editors have special features for: commenting out a block, indenting with a prefix, turning paragraphs into a list. Select the lines, split them, edit once.

Work through the checklist below to turn a shopping list into bullet points.

  1. Select all three lines with x Each press takes in one more line, so press x x x.
  2. Split the selection into lines with Alt-s One cursor per line, each covering its text, appears when you hold Alt and press s.
  3. Insert at the start of every line with I The statusline flips to INS and every cursor jumps to column 1 when you press I.
  4. Type - (a dash and a space), then hit Escape Every line should now be a bullet point.
Select all three lines with x Each press takes in one more line, so press x x x.

Next: Split the selection into lines with Alt-s

Loading editor…