553
submitted 1 week ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 33 points 1 week ago* (last edited 1 week ago)

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

:wq
[-] [email protected] 5 points 6 days ago

:x is also an alternative to save and quit.

Equally valid for the facial expression you'd make upon finding that out.

[-] [email protected] 1 points 6 days ago

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.

[-] [email protected] 29 points 1 week ago

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

[-] [email protected] 7 points 1 week ago

! If you edited the buffer at all. ๐Ÿ‘

[-] [email protected] 8 points 1 week ago

With random flailing, most likely

[-] [email protected] 15 points 1 week ago* (last edited 1 week ago)

๐Ÿ˜ณ

:w = write; or overwrite if the file already exists.

Please donโ€™t give blanket destructive advice.

[-] [email protected] 3 points 1 week ago

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

[-] [email protected] 3 points 6 days ago

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/

[-] [email protected] 14 points 1 week ago

also worth noting you open vim the first time, you get a huge ass splash screen telling you how to exit

[-] [email protected] 1 points 1 week ago

Only if you donโ€™t immediately open a file.

[-] [email protected] 6 points 1 week ago

And if you panicked before and fucked up the opened file while hammering on the keyboard:

:q!
[-] [email protected] 5 points 1 week ago

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.

[-] [email protected] 2 points 1 week ago

This is the most correct answer.

Rebind Caps to Esc.

ZZ (or ZQ if you don't want to save the file).

this post was submitted on 09 Jun 2025
553 points (97.6% liked)

Programmer Humor

24241 readers
1323 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

founded 2 years ago
MODERATORS