Hacker News new | past | comments | ask | show | jobs | submit login
[flagged] How to Exit Vim (github.com/hakluke)
56 points by WayToDoor 22 days ago | hide | past | favorite | 24 comments



Walk over to that one guy's desk at the office, you know the one. Ask for his help. Then you just have to wait through about 5 minutes of "Modal editors are very simple once you know how they work! A command is composed of..." and after that he'll tell you what keys to press.


I assume somebody thought this was funny?


A lot of people did, look at the contributors

There's this subculture in the computer world, the pinnacle of which is arguably still Eric Raymond's Jargon File (http://catb.org/jargon/html/) which I could never connect with it.


Clarification, ESR didn't originate the jargon file. He edited and published an edition of it, but he wasn't the first to do so.

"The Story of Mel" and "Sussman Attains Enlightenment" are stories I come back to every so often.

There's similar stuff here: http://www.thecodelesscode.com/contents

I sure hope the jargon file isn't the pinnacle. Not because of any problem with it, I just hope we will surpass a collection last majorly edited 30 years ago.


That's kind of what makes it un-funny, there's like 100 repetitions of the same joke. How can that be funny?

I think it’s funny, though didn’t have the attention span to read through all of it.


Humor is subjective, but for me it was one of those chuckles that turned into "this is getting too long". And then you realize it goes on for so long with so many technologies that it loops around to being funny again, or simply impressive at what a high effort troll this was.


I've seen this shared around amongst devs in 3 consecutive jobs I've worked at, so yeah probably a few people.


I guess. It is non-ideal how unintuitive it is to exit vim, but esc-esc-q-! is really not that complicated.


I feel like you're missing a few esc's and a colon in there...


zz? Only one esc, but definitely a colon. vim is weird. Works for me, but I understand it’s not suitable for everyone’s tastes.


zz centers the screen on the current line. Use ZZ to save the file and quit. Use ZQ to not save but quit.


oh, I love vim! I still hit esc anywhere between 5 and 7 times before typing :wq to save my work.


I love Vim. I use it pretty much exclusively. I found it very funny.

So, yes.


If you do the first example, won't that lead to a .swp file still being present, then a warning next time you start vim?


<lobbing hand grenade>

Modal editing is fundamentally-insane UX.


I remember one “how to exit vim” tutorial that explored key combinations that would exit vim regardless of what mode you’re currently in:

:q! works in command mode, but obviously not in insert mode. <ESC>:q! works in insert mode and incidentally also in command mode, but not in ex mode (extended command mode)! And so on, a longer and longer command is built that neutralises the current mode and whatever side effects that the key combo itself causes.


I mean maybe, but I sure edit shit fast


Would you mind to elaborate?


Handy reference. I typically use a variant of "the suspend way," but I might try "the canonical way" one day.


I didn't get that far on first read, I assumed the Canonical way was "snap install vim; vim; systemctl stop snapd" or something.


out-of-band way:

echo "cd /system1/pwrmgtsvc1; reset" | ssh -T ADMIN@<BMC-IP>


Bravo. Plus makes for an excellent demonstration of the flexibility of unix


My go-to:

`Ctrl-Z, kill -9 %1`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: