Course Lessons
Free Trial: 5 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!
Congratulations! You've been editing in Vim like a pro.
Now comes the moment of truth - saving and exiting Vim.
Yes, we know about the memes. But here's the thing:
In our browser-based environment, you're ALWAYS in Vim.
Why? Because we don't let anyone touch the Linux system
without being safely wrapped in our Vim editor.
So when you type :wq to save and exit, your session will end.
And that's totally OK! It means you've learned the way.
To save your work and exit Vim to complete this lesson:
1. Make sure you're in Normal Mode (press Escape)
2. Type :wq and press Enter (w = write/save, q = quit)
3. Your session will end (don't panic!)
4. You can submit and move forward
Remember: Every Vim user has googled 'how to exit vim'.
You're in good company!