Settings

Theme

How to Exit Vim

github.com

56 points by WayToDoor 2 years ago · 24 comments

Reader

fallingsquirrel 2 years ago

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.

callamdelaney 2 years ago

I assume somebody thought this was funny?

  • kristopolous 2 years ago

    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.

    • maxbond 2 years ago

      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.

    • callamdelaney 2 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?

  • sodapopcan 2 years ago

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

  • johnnyanmac 2 years ago

    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.

  • rajamaka 2 years ago

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

  • ghostly_s 2 years ago

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

    • squid_ca 2 years ago

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

      • jfoutz 2 years ago

        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.

        • AnonHP 2 years ago

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

        • squid_ca 2 years ago

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

  • chimpansteve 2 years ago

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

    So, yes.

aussieguy1234 2 years ago

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?

nvy 2 years ago

<lobbing hand grenade>

Modal editing is fundamentally-insane UX.

  • sshine 2 years ago

    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.

  • BxGyw2 2 years ago

    I mean maybe, but I sure edit shit fast

  • xigoi 2 years ago

    Would you mind to elaborate?

skygazer 2 years ago

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

  • akdor1154 2 years ago

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

lvlabguy 2 years ago

out-of-band way:

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

jonwinstanley 2 years ago

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

mmastrac 2 years ago

My go-to:

`Ctrl-Z, kill -9 %1`

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection