Step 4 of 5

Flipping the anchor and head

Flipping the anchor and head

Every selection has two ends. The anchor is where the selection started, and the head is where your cursor is. Motions move the head, which is why a selection grows in only one direction.

Alt-; swaps the two ends, putting the cursor on the anchor. Remember this one, because it’s really handy! It means the position you started a selection from isn’t fixed.

For example, if you build a selection and realize the start is in the wrong place, you don’t have to collapse it and begin again. Press Alt-;, move the cursor to fix the start, and press Alt-; again to carry on from the other end.

Work through the checklist below — you’ll see that it’s possible to adjust a selection in both directions.

  1. Select the first line with x With the cursor anywhere on the first line, press x — the cursor lands at the end of the line.
  2. Jump to the other end with Alt-; Hold Alt (Option on a Mac) and press ; — the selection stays, and the cursor jumps to the start of the line.
  3. Jump back again To get back where you were, press Alt-; a second time.
Select the first line with x With the cursor anywhere on the first line, press x — the cursor lands at the end of the line.

Next: Jump to the other end with Alt-;

Loading editor…