vi editing  «Prev 

Searching for text using ?, /, n, and N

1) First open the phonelist file. The cursor appears in the upper left corner, at the start of line 1.
First open the phonelist file. The cursor appears in the upper left corner, at the start of line 1.

2) When you press/ to start a forward search, your cursor goes to the status line.
When you press/ to start a forward search, your cursor goes to the status line.

3) Press Enter and the cursor moves to the text 28, which is the first instance that the regular expression 2 matches.
Press Enter and the cursor moves to the text 28, which is the first instance that the regular expression 2 matches.

4) To search again, press n, a command that does not appear on the screen.
To search again, press n, a command that does not appear on the screen.

5) Press? to a start a backward search. Notice the cursor again goes to the status line.
Press? to a start a backward search. Notice the cursor again goes to the status line.

6) Press Enter and the backward search begins from the last cursor position, 23 and goes up to 16, the nearest match.
Press Enter and the backward search begins from the last cursor position, 23 and goes up to 16, the nearest match.