How to exit VIM? 4 simple ways

preview_player
Показать описание
VIM is one of the best pieces of software ever created. But the way you are supposed to exit it can be a major PITA. Of course, only if you don't know how to do it. Here are four ways of exiting VIM with and without saving your work.

Рекомендации по теме
Комментарии
Автор

Saved my life man! I only had console access to a VM through its hypervisor and there was no key to type the colon. ALT+ASCII wouldn't work either. I didn't know ZZ would do the trick. I was able to map the MACs with their interface properly with that trick to regain remote access. Thanks a lot!

adalamilton
Автор

I used Unix for the first time 33 years ago. I hated vi because it was so cryptic. I learned it and it became my editor of choice. Before Unix I worked on DEC systems, the best I had known. But Unix, later Linux was just so much better, more lean and quick.
I love vi. 😁😊💪

rjung_ch
Автор

I don't think you need the "!" after the ":wq". You only need it when you are NOT saving (ie: ":q!") to confirm that you really want to quit without writing. Saving the world...one keystroke at a time!

sgilb
Автор

These commands bring up memories from the early 90’s.
The UNIX vi editor…

bertbeinaaf
Автор

I prefer nano. Much simpler more minimalist. Cheers mate!😊🍻

mariofpv
Автор

and my friend told me that i surely wouldn't know how its done

patrick
Автор

you missed the 3rd way of exiting and saving.... ":x" :D

WXCB
Автор

What's going on with your fpv Channel?

highwaymen
Автор

and the best way to have a room of proud sysadmins to start questioning their sanity is to change keyboard layout to one of those where Y and Z is reversed and :/; is accented character, ie. infamous POLSKI MASZYNISTKI

one day we're closing tasks like usual when manager asks aloud:
"gentelman, how do I close vi?"
there was a lot of snickering until each one of us tried it on his computer:

:wq - nope, that's not working as it used to work everyday for past decade, with keyboard map changed vi just gets Łwq, so nothing starting from : was working (or echoing on the screen)

ZZ - nope, with that keyboard map it just yanks the line, the Y and Z are reversed

ps wx, kill, ssh to different system. rm ~/.vi - none of those required Z or Y pressed, we trully were lost

I think there were five of us, with about half of a century of combined experience, just generating trully random sequences for ten minutes.
not to brag but I solved it on \d\dth try by forgeting Esc before ZZ and finally seeing what does that key really puts

grzbiet