Step 6 of 6

Jumping to matching characters

Jumping to matching characters

Certain characters come in opening and closing pairs. For example (), {}, and [].

Sometimes, you’ll want to jump from the opening character to the closing character, or vice-versa. Helix has a command for that: mm in normal mode. The first m opens the match menu, and the second picks “matching bracket”.

(If you’re coming from Vim, note that % is something else entirely in Helix: it selects the whole file.)

There’s some matching bracket pairs set up for you in the editor. Work through the checklist below to put mm through its paces.

  1. Jump to the matching bracket The cursor starts on the opening ( — to land on its partner, type mm.
  2. Jump back again To bounce back to the opening (, type mm a second time.
  3. Match the curly braces Put the cursor on the { a few lines down (5gg), then type mm.
  4. Untangle the mess Find the partner of the very first ( in the pile — 16gg puts you on it, then type mm.
Jump to the matching bracket The cursor starts on the opening ( — to land on its partner, type mm.

Next: Jump back again

Loading editor…