Bird
0
0

You accidentally pressed i in Vim but want to cancel insert mode without saving changes. What is the correct sequence?

medium📝 Debug Q7 of 15
Linux CLI - Viewing and Editing Files
You accidentally pressed i in Vim but want to cancel insert mode without saving changes. What is the correct sequence?
APress Esc then type :wq
BPress Esc then type :q!
CPress Ctrl+C then type :w
DPress Ctrl+Z then type :q
Step-by-Step Solution
Solution:
  1. Step 1: Exit insert mode

    Press Esc to leave insert mode and return to command mode.
  2. Step 2: Quit without saving

    Type :q! to quit Vim discarding changes.
  3. Final Answer:

    Press Esc then type :q! -> Option B
  4. Quick Check:

    Cancel insert + quit no save = Esc + :q! [OK]
Quick Trick: Esc then :q! quits without saving [OK]
Common Mistakes:
  • Using Ctrl+C which interrupts but doesn't quit
  • Using :wq which saves changes
  • Using Ctrl+Z which suspends Vim

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes