Step 3 of 5

Collapsing selections

Collapsing selections

Once a selection has grown, you’ll often want to shrink it back down to a single character. In Helix, ; collapses the selection onto the cursor.

This works in both normal and select mode, and it’s the answer to a question Vim users ask early: “how do I get rid of this selection?” Pressing Escape takes you back to normal mode, but it leaves the selection exactly where it was. That’s by design — a selection is never in your way, because the next motion replaces it anyway. When you do want it gone, reach for ;.

A couple of things to remember:

  • ; collapses onto the cursor — the head of the selection, wherever it is
  • v toggles the mode and ; shrinks the selection; they’re independent

Work through the checklist below.

  1. Build a selection With the cursor at the start of the first line, press v, then w until A big selection is highlighted.
  2. Collapse it with ; Press ; — the highlight shrinks to just the cursor.
  3. Return to normal mode The statusline reads NOR again when you press v.
Build a selection With the cursor at the start of the first line, press v, then w until A big selection is highlighted.

Next: Collapse it with ;

Loading editor…