Difficulty: Easy
Correct Answer: 3 dw
Explanation:
Introduction / Context:
The vi editor (and its improved version, Vim) is ubiquitous on UNIX/Linux. Efficient editing depends on mastering operator + motion combinations. Deleting multiple words in one keystroke is a common task that highlights how counts and motions work together in vi's modal editing model.
Given Data / Assumptions:
Concept / Approach:
In vi, d is the delete operator and w is the word motion (move to the start of the next word). Prefixing with a count multiplies the motion. Thus, 3dw or d3w deletes three words forward. The option shown as “3 dw” represents this combined form with a count of 3 applied to dw.
Step-by-Step Solution:
Determine the operator: d (delete).Determine the motion: w (word forward).Apply a count of 3: 3dw (equivalently d3w).Result: three words ahead of the cursor are removed and stored in a register.
Verification / Alternative check:
Try variants such as d3w, which performs the same action. For whole words including trailing space behavior, 3de or 3dW can be compared to understand the difference between word and WORD motions.
Why Other Options Are Wrong:
3$d: deletes from cursor to the end of line, not three words.3 x: deletes three characters, not words.3 dd: deletes three lines, not words.
Common Pitfalls:
Final Answer:
3 dw
Discussion & Comments