Difficulty: Easy
Correct Answer: to the beginning of the line specified by the number
Explanation:
Introduction / Context:
Efficient navigation is the hallmark of expert vi/Vim usage. Jumping directly to a specified line saves time when editing large files or investigating error messages that include line numbers. The [number]G motion is one of the fastest ways to reposition the cursor precisely.
Given Data / Assumptions:
Concept / Approach:
In normal mode, G without a count moves to the end of the file. Prepending a count moves to that exact line number. The cursor is placed at the first non-blank character of the target line (behavior may vary slightly with settings), effectively moving to the beginning for editing purposes.
Step-by-Step Solution:
Verification / Alternative check:
Use :120 as an alternative command-line mode jump, which also moves to line 120. Both methods place the cursor on the specified line, confirming the mapping of [line number] + G.
Why Other Options Are Wrong:
Common Pitfalls:
Using lowercase g (a different motion in Vim), forgetting to be in normal mode, or typing an invalid line number, which causes movement to the nearest valid boundary (start or end). For extremely large files, consider :set number and search commands like /pattern to combine jumps and searches.
Final Answer:
to the beginning of the line specified by the number
Discussion & Comments