Step 2 of 4

Jumping between matches

Jumping between matches

Once you’ve made a search, you can jump between its matches with the n and N keys.

  • n selects the next match, further down the document
  • N selects the previous match, further up

If you’ve used Vim, note one difference: in Helix n always goes forward and N always goes backward, no matter whether you started the search with / or ?.

Searches wrap around by default, so if you’re on the last match in the document and you press n, you’ll be taken back to the first match.

Each jump replaces your selection with the new match, so whatever you land on is ready to act on, just like the first one was.

Work through the checklist below. This time there are four NEEDLE lines among the hay — search for NEEDLE (and confirm it with Enter, not Escape, or n will have nothing to jump to), then use n and N to jump between the matches and wrap back around to where you started.

  1. Search for the needles You'll land on the first of four NEEDLE lines as you type /NEEDLE.
  2. Jump to the next match The second needle is further down — press n.
  3. Jump back to the previous match You'll hop back up to the first needle — press N.
  4. Wrap around the document Two more needles wait below; keep pressing n until the search wraps back to the first one.
Search for the needles You'll land on the first of four NEEDLE lines as you type /NEEDLE.

Next: Jump to the next match

Loading editor…