← All lessons

8. Searching

Step 2 of 7

Jumping between matches

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

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

Try this in the editor. This time, there are a few NEEDLE lines among the HAYSTACK lines. Start searching for NEEDLE, and then use n and N to jump between the different matches.

Loading editor…