Live data from Hacker News

How to Exit Vim

github.com

291–300 of 409 posts

Re: How to Exit Vim

#291
post #127
post #95

In the opposing vein, as an Emacs user the best configuration I ever made was to rebind C-x C-c to execute-extended-command instead of kill-emacs. It was way too easy to (even accidentally!) kill emacs with a sweep of a finger. And I probably use a few hundred execute-extended-command calls for each kill-emacs (which I now have to type manually as 'C-x C-c kill-emacs' - no problemo). A similar optimisation was with t…

How do you exit, then, if you never learned :q?

ctrl-z to background it. Then `kill` it.

Re: How to Exit Vim

#292

As the old joke says[1]. ED(1) Unix Programmer's Manual NAME ed - text editor SYNOPSIS ed [ - ] [ -x ] [ name ] DESCRIPTION Ed is the standard text editor. [1] https://www.gnu.org/fun/jokes/ed-msg.html

I've written the following one-liner if ed(1) is unavailable on your system, to emulate its functionality: trap 'echo -e "\n?"' INT; while true; do read; echo "?"; done

:), Yeah, those were the days!

Re: How to Exit Vim

#293
post #288

Very clever, but I wish they would put the real way, which, for the record, is :q at the top so that this doesn't annoy people who legitimately google it and have to wade through this.

But any of the other methods work just as well

Not by the metrics "tediousness" and "applicability to later vim usage".

Re: How to Exit Vim

#294
After I invent time travel I'm going to mail my 30-years-ago self a T-shirt that says "Colon Q Bang" on the front and "You're Welcome" on the back. It will save myself much anguish.

Re: How to Exit Vim

#296

Earlier quoted context omitted.

git will open pico if you haven't configured an editor. It's annoying. If you have configured an editor, hopefully you already know how to quit.

It has to open something, and pico/nano, at least, has a menu that tells you how to quit. What else would be a preferable default?

I'm open to the idea that there isn't a better default, but that doesn't make it less annoying.

Another option would be to fail and prompt the user to configure an editor preference. That wouldn't be much different (to me) than what it does now.

Re: How to Exit Vim

#297
post #177

Earlier quoted context omitted.

I think that's a great suggestion and probably gets the root of the whole exit vim meme.

I don't have a qa key though

I’ll laugh about this now but then probably find out later that it was actually based on an obscure teletype terminal that actually had an “qa” key.

Re: How to Exit Vim

#298
post #288

Very clever, but I wish they would put the real way, which, for the record, is :q at the top so that this doesn't annoy people who legitimately google it and have to wade through this.

This page is well at the bottom of the first results page, and vim tells you how to exit it now when you try things like ctrl+c. I don't think anyone is in danger. https://i.imgur.com/b6dqBiV.png

Re: How to Exit Vim

#299
post #273

Earlier quoted context omitted.

Did you save any?

Yes, I was able to save the file using ZZ rather than :w It's been a long time, but I was probably hung up on not being able to experimentally figure out : commands, where I was able to figure out control-z and ZZ.

ZZ exits vi(m) though?

Re: How to Exit Vim

#300
post #288

Very clever, but I wish they would put the real way, which, for the record, is :q at the top so that this doesn't annoy people who legitimately google it and have to wade through this.

This page is well at the bottom of the first results page, and vim tells you how to exit it now when you try things like ctrl+c. I don't think anyone is in danger. https://i.imgur.com/b6dqBiV.png

>This page is well at the bottom of the first results page

It's at the bottom now, yes, but if this (and copycats) takes off, it won't be. I've seen cases where the search results get so dominated by oh-so-clever parodies that are mixed in with legit answers that you can't tell which is which.

>vim tells you how to exit it now when you try things like ctrl+c.

Which is great, if that version of vim universally replaced all the others, and every newbie was aware of ctrl-C.

For context: in 2011, I tried the project Open Hatch, specifically designed for newbies, and if you followed their tutorial instructions, you could get dumped into a vim terminal with no idea how to get out.

>I don't think anyone is in danger.

With respect, I'd suggest updating your criteria for making this judgment.

Post reply on HN