Difficulty: Easy
Correct Answer: /
Explanation:
Introduction / Context:
Efficient navigation and searching are central to productivity in vi/vim. The editor uses concise keystrokes to start searches in the forward or backward direction and to repeat them without retyping the pattern.
Given Data / Assumptions:
Concept / Approach:
In vi, the forward search command is “/”. After pressing “/”, you type the pattern and press Enter. The backward search equivalent is “?”. To repeat the last search in the same direction, press “n”; to reverse direction, press “N”. The doubled forms “//” and “??” are not the defined initiators; the first slash or question mark begins the command, and the rest are treated as part of the pattern.
Step-by-Step Solution:
Verification / Alternative check:
Try “?” with the same pattern to verify that it searches backward; observe the difference in match direction while using n/N.
Why Other Options Are Wrong:
? initiates backward search. // and ?? are not separate commands; the extra character becomes part of the search string. None: incorrect because “/” is correct.
Common Pitfalls:
Remaining in insert mode; forgetting to press Enter after typing the pattern; misunderstanding n/N direction behavior.
Final Answer:
/
Discussion & Comments