Bird
0
0

You want to quickly add the line "# TODO" at the start of a file in Vim, save, and quit. Which sequence of keys and commands is correct?

hard📝 Application Q15 of 15
Linux CLI - Viewing and Editing Files
You want to quickly add the line "# TODO" at the start of a file in Vim, save, and quit. Which sequence of keys and commands is correct?
APress <code>I</code>, type "# TODO", press <code>Esc</code>, then <code>:wq</code>
BPress <code>o</code>, type "# TODO", press <code>Esc</code>, then <code>:q</code>
CPress <code>a</code>, type "# TODO", press <code>Esc</code>, then <code>:w</code>
DPress <code>i</code>, type "# TODO", press <code>Esc</code>, then <code>:wq</code>
Step-by-Step Solution
Solution:
  1. Step 1: Insert text at start of line

    Pressing I (capital i) enters insert mode at the start of the current line.
  2. Step 2: Type text, exit insert mode, save and quit

    Type "# TODO", press Esc to exit insert mode, then :wq to save and quit.
  3. Final Answer:

    Press I, type "# TODO", Esc, then :wq -> Option A
  4. Quick Check:

    I inserts at line start, :wq saves and quits [OK]
Quick Trick: Use I to insert at line start, then :wq to save and quit [OK]
Common Mistakes:
MISTAKES
  • Using i inserts before cursor, not line start
  • Using o inserts new line below
  • Using :q quits without saving

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes