Live data from Hacker News

How to Exit Vim

github.com

41–50 of 409 posts

Re: How to Exit Vim

#41
post #14

Oh looks, it's only been 10 minutes since the last Vim article was trending on HN, we're rivalling Hollywood levels of bubble here. Seriously, when CES is currently showing hundreds of new tech products and services, including a Hyundai electric helicopter - Vim is what we still talk about?

CES hasn’t been relevant in the past decade. Why would we care?

Re: How to Exit Vim

#42
post #14

Oh looks, it's only been 10 minutes since the last Vim article was trending on HN, we're rivalling Hollywood levels of bubble here. Seriously, when CES is currently showing hundreds of new tech products and services, including a Hyundai electric helicopter - Vim is what we still talk about?

Oh look, it’s only been 10 minutes since somebody complained that a post shouldn’t be on HN or that a topic is over represented and what a bubble HN is!

Re: How to Exit Vim

#43
post #29

I came into this with a sense of "oh not again" and came out surprisingly happy. TIL that ZZ, ZQ exist and that a disown command exist on the command line. Also my preferred method from the list is the timeout, it would be nice to have counter in a corner of the vim window to know how much time is left though.

What I do is I set a 25 min timeout, so not only it exits vim it also acts as a Pomodoro timer for me. Two birds, one stone.

Re: How to Exit Vim

#44

Fun read! My next bash exercise will be to try and understand some of these commands, quite a feat! greping the ps output would work with any program, right ? That was pretty cool. Killing it from emacs was def a good laugh ! They should add the script kiddie way: `sudo rm -rf /` ^^

That might delete the executable but the process would still be running.

Yep, `ps | grep` is a common and useful idiom!

Re: How to Exit Vim

#45
I do not like the grep -v grep pattern. I think the regexp trick should be prefered:

    :!ps axuw | grep [v]im | awk '{print $2}' | xargs kill -9
This can also be merged in the awk command:

    :!ps axuw | awk '/[v]im/{print $2}' | xargs kill -9

Re: How to Exit Vim

#46

The question is not "How" but "Why" you would want to ever do that in the first place;-) Many years ago I knew a university professor and students said about him he might leave uni occasionally but he sure never leaves Emacs. Some live in Emacs, some live in Vim.

I live in a different universe to you it seems. The only vim command I know is :q . Honestly, I tried several times over the decades and walked away with my head buzzing. PS: I don't live in emacs either! What I do love in both camps is how the explanations begin... "All you have to do is...[insert irrational (to non-vim/emacs users) command]" which makes me laugh every time. Love the article, which ironically proves…

[deleted]

Re: How to Exit Vim

#48

The question is not "How" but "Why" you would want to ever do that in the first place;-) Many years ago I knew a university professor and students said about him he might leave uni occasionally but he sure never leaves Emacs. Some live in Emacs, some live in Vim.

I honestly don't know how vim deals with unsaved changes upon shutdown and don't use it enough to look that up, so that's why I'll first exit.

As to why shutdown: cultural thing in the end. I was raised with the idea that wasting is bad (and objectively speaking it's very hard to argue with that) so if I don't need the machine running after I'm done with it, I just can't stand the idea of the thing using energy literally for nothing.

Re: How to Exit Vim

#49
post #7

pssh.. they didn't mention the vimtectualist way - :q! or the French way - ZZ

As a vim noob, I needed to look it up [0]. ZZ saves the current file if modified and closes it. ZQ closes it without saving. Thank you, that will save me a few seconds per year. Why the French way? I don't get it and I am very curious :-) [0] https://unix.stackexchange.com/questions/93144/exit-vim-more...

(Wild guess) If you pronounce the command aloud - "Zee-zee" - it translates to "Willy" (penis word used by children) in French. Easy mnemonic.
Post reply on HN