554
Vim is built different
(lemmy.ml)
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.
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.