Vim lessons
Practice
Advanced
10 min
Search Navigation Mastery
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
Your submission is checked for these keystrokes, not just the final text — so reach for the technique, not a workaround.
- / Use forward search
- n Navigate to next match
Helpful commands
- /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
Stuck? Peek at a hint 3 hints · try it on your own first
- / searches forward, ? searches backward
- n = next match in same direction, N = next match in opposite direction
- Add \c for case-insensitive search: /error\c
" Read the task on the left.
" A live Vim editor opens right here.
" Finish the edits, then submit.
~
~
NORMAL