this post was submitted on 09 Jun 2025
549 points (97.4% liked)
Programmer Humor
24173 readers
584 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Personally, I have seen so many memes about exiting vim that by the time I got to use it for the first time, exiting it was a no-brainer.
For any newbies out there, the command is
Just to add: possible need to tap esc first, as your random flailing probably put you in insert mode, or something more exotic.
And only add w if you want to save the file. :q! If you don't
! If you edited the buffer at all. 👍
With random flailing, most likely
😳
:w
= write; or overwrite if the file already exists.Please don’t give blanket destructive advice.
This one's fine. They'll then learn the next vim button, u for undo. I believe it's saved between boots of vim? It may be my kickstarted neovim config tho
I would say not in all installations, no. And honestly, it’s not worth trusting.
And for those who are unfamiliar, and want to set it up: https://blog.openreplay.com/persistent-undo-vim-save-restore-history/
also worth noting you open vim the first time, you get a huge ass splash screen telling you how to exit
Only if you don’t immediately open a file.
:x
is also an alternative to save and quit.Equally valid for the facial expression you'd make upon finding that out.
And if you panicked before and fucked up the opened file while hammering on the keyboard:
There's also
ZZ
👉😎👉 Same caveats apply, smash that fukken esc key (for bonus points rebind caps lock as esc) then ZZ Top your way out of that shit.This is the most correct answer.
Rebind Caps to Esc.
ZZ (or ZQ if you don't want to save the file).
I'm going to stick with my current process of accidentally opening vim, typing semi-random things that feel like they should work for a minute and then eventually looking up how to quit on my phone.