Step 3 of 6

Hopping between brackets

Hopping between brackets

Before we go further into selecting, there’s one match-mode command that simply moves: mm jumps the cursor to the bracket that matches the one under it. Put the cursor on a ( and mm takes you to its ); press it again and you’re back where you started.

It works for every kind of bracket pair — (), [], {} and <> — and it’s the fastest way to find out where a long condition or a nested call actually ends. The cursor does need to be on one of the brackets; in a plain-text buffer like this one, mm anywhere else stays put.

Like every movement in Helix, mm also extends a selection when you’re in select mode: v then mm selects from one bracket to its partner, brackets included.

Try it in the editor. Work through the checklist below to hop across the parentheses and back.

  1. Jump to the matching bracket From the start of the last line, f( lands on the first (. Then type mm.
  2. Jump back again Type mm once more to return to the opening (.
Jump to the matching bracket From the start of the last line, f( lands on the first (. Then type mm.

Next: Jump back again

Loading editor…