Difficulty: Easy
Correct Answer: fch
Explanation:
Introduction / Context:
Efficient navigation in the vi editor relies on single-keystroke motions. When you need to jump directly to a specific character ahead on the same line, vi provides concise commands that reduce cursor keystrokes and speed up edits in code and configuration files.
Given Data / Assumptions:
Concept / Approach:
The motion f{char} moves the cursor forward to the next occurrence of {char} on the current line. The mnemonic is “find”. The related t{char} motion moves to the position just before {char} (“till”). You can repeat the last f/t search using ; to go forward again or , to go backward to the previous match.
Step-by-Step Solution:
Enter normal mode (press Esc if necessary).Type f followed by the target character, e.g., f( or f, or fa.The cursor jumps to the first matching character to the right on the same line.Use ; to move to the next occurrence or , to move to the previous one.
Verification / Alternative check:
Compare with tch (“till”): t, places the cursor before the comma rather than on it. If no match exists to the right, vi reports a beep/error and the cursor does not move.
Why Other Options Are Wrong:
tch (Option A) stops just before the character, not on it.rch (Option C) and ech (Option D) are not valid vi motions.None of the above (Option E) is incorrect because fch is the intended notation for f followed by ch.
Common Pitfalls:
Final Answer:
fch
Discussion & Comments