You're viewing a single thread.
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
35 0 ReplyJust 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
30 0 Reply! If you edited the buffer at all. 👍
6 0 ReplyWith random flailing, most likely
7 0 Reply
😳
:w
= write; or overwrite if the file already exists.Please don’t give blanket destructive advice.
15 0 ReplyThis 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
3 0 ReplyI 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/
3 0 Reply
also worth noting you open vim the first time, you get a huge ass splash screen telling you how to exit
14 0 ReplyOnly if you don’t immediately open a file.
1 0 Reply
And if you panicked before and fucked up the opened file while hammering on the keyboard:
:q!
6 0 ReplyThere'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.5 0 ReplyThis is the most correct answer.
Rebind Caps to Esc.
ZZ (or ZQ if you don't want to save the file).
2 0 Reply
:x
is also an alternative to save and quit.Equally valid for the facial expression you'd make upon finding that out.
5 0 ReplyI'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.
1 0 Reply