Inspect and reuse a search
The technique
* searches for the word under the cursor. n repeats the search in the same direction.
Keys in this lesson
- n
- Next match.
- N
- Previous match.
- *
- Search for the word under the cursor.
- #
- The same, backward.
Before this lesson: Search for a destination.
More about this lesson
Repeat or reverse a search and distinguish whole-word matching.
n repeats the direction of your last search; N reverses it. After ?, n still searches backward. * searches forward for the whole word under the cursor; # searches backward. /cat may match catalog; * from cat skips catalog. Inspect each destination before editing an exception.
Example
With three separate “ready” lines, /ready then Enter reaches the first next occurrence and n the following one. N returns to the previous match. Search movement does not itself modify any text.
Use Reset to try again.