Course Lessons
Free Trial: 4 lessons remaining
Unlock Full Access
The Great Escape: How to Exit Vim
Estimated time: 10 minutes
Task Instructions
Learn the legendary :wq command - save your work and exit like a pro!
To complete this lesson, you need to save and exit Vim using :wq. Yes, this will end your browser Vim session - that's exactly what should happen! We keep everyone in Vim for safety, so exiting means you're done. Press Escape to ensure you're in Normal Mode, then type :wq and press Enter.
Learning objectives
- Learn how to save and exit Vim with :wq
- Understand why the session ends (it's a feature, not a bug!)
- Gain confidence that breaking the session is the correct answer
- Join the ranks of those who know how to save and exit Vim
Required Keystrokes
This lesson requires you to use specific keystrokes to complete it. Your submission will be evaluated based on whether you used the required keystrokes mentioned below, rather than matching a specific output.
:wq
Save and exit Vim using :wq
What This Means
- Your solution must include the required keystroke patterns
- The order of keystrokes may matter depending on the exercise
- You'll still need to achieve the expected output
- This helps you practice specific Vim techniques
Helpful commands:
Command | Description |
---|---|
:q | Quit Vim (when no unsaved changes) |
:q! | Force quit without saving changes |
:wq | Save and quit |
:x | Save and quit (shorthand) |
ZZ | Save and quit (no colon needed) |
Hints
- Press Escape first to make sure you're in Normal Mode
- Type :wq (colon then w then q) and press Enter
- When the session ends, that means you did it right!
Ready for Vim?
Before starting this lesson, be prepared.
Read the directions on the left, and when you're ready, let's go!