Screen Too Small

This course material requires a larger screen to properly display the terminal and editor interfaces.

Please use a tablet, laptop, or desktop computer for the best learning experience.

You can continue browsing, but the experience will be significantly limited.

Search Navigation Mastery

Estimated time: 10 minutes

Task Instructions

Become an expert at finding and navigating search results

Practice searching through code. Use /error to search forward for 'error', then use n to go to next match and N for previous match. Try ?error for backward search.

Learning objectives

  • Master forward and backward search
  • Perfect search result navigation
  • Learn search patterns and options

Required Keystrokes

This lesson requires you to use specific keystrokes to complete it. Your submission will be evaluated based on whether you used the required keystrokes mentioned below, rather than matching a specific output.

/
Use forward search
n
Navigate to next match

What This Means

  • Your solution must include the required keystroke patterns
  • The order of keystrokes may matter depending on the exercise
  • You'll still need to achieve the expected output
  • This helps you practice specific Vim techniques

Helpful commands:

Command Description
/pattern Search forward for pattern
?pattern Search backward for pattern
n Go to next search match
N Go to previous search match
* Search for word under cursor
# Search backward for word under cursor

Hints

  • / searches forward, ? searches backward
  • n = next match in same direction, N = next match in opposite direction
  • Add \c for case-insensitive search: /error\c

Ready for Vim?

Before starting this lesson, be prepared.

Read the directions on the left, and when you're ready, let's go!