Live data from Hacker News

How to Exit Vim

github.com

301–310 of 409 posts

Re: How to Exit Vim

#301

Earlier quoted context omitted.

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?

Yes, it sure does! Well, after 30 years, my memory of the particulars is a bit hazy. (:

Re: How to Exit Vim

#303
post #300

Earlier quoted context omitted.

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 replac…

You're being a little dramatic

Re: How to Exit Vim

#304
post #104

Earlier quoted context omitted.

I believe the solution to this lies in using Rust and SIMD. It will achieve both performance and safety.

I would prefer a functional approach and formal verification so we can know for sure it will exit.

Let me halt you right there...

Re: How to Exit Vim

#305
post #300

Earlier quoted context omitted.

>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 replac…

You're being a little dramatic

As long as we're giving feedback, you could do better on empathy for those who don't know the same things you do.

Re: How to Exit Vim

#306
post #241
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…

> A similar optimisation was with tmux to bind the prefix to C-z. It's in a handy location next to ctrl and I very rarely use suspend anyway. I think gnu screen has the right idea here: ctrl-a. And you say z is close to control - does that mean you use emacs without shift lock as control?! (I mean sure, still closer than b...).

I use ctrl-a quite a lot on the command line, though.

Re: How to Exit Vim

#307

- So, how did you learn Vim? I heard there's quite a learning curve. - I just open it, but I couldn't figure out how to quit. Then I have been using it for three years already. (Same applies to Emacs.)

The accepted answer here [1] is what got me to see the light. Once I realized how composable the main commands are, vi became kind of fun.

I still prefer Emacs because of macros and org-mode, but I no longer fear vi when I'm doing a quick edit, editing a huge file, or on a emacsless new machine.

[1] https://stackoverflow.com/questions/1218390/what-is-your-mos...

Re: How to Exit Vim

#308
The funniest one is the "experienced product manager way" IMO. I've seen plenty of those "experienced project managers" work, and the description is spot on. It's amazing that such impediment to productivity is even tolerated, let alone paid handsome amounts of money for. All while the company _thinks_ they're getting better productivity.

Re: How to Exit Vim

#309

Earlier quoted context omitted.

It’s a college class in which students are supposed to learn something new, that seems like a perfect example of a situation where you should be forced to do something outside your comfort zone. I don’t interpret that as the college professor saying this is actually the best way to code, just that forcing students to struggle through it is a learning experience.

> It’s a college class in which students are supposed to learn something new Unless the central thrust of the course is supposed to be the mechanics of a particular dated editor, the restriction described seems to be a distraction from rather than an aid to what the students are supposed to be learning. It doesn't make any more sense than a social science course where the deliverables for most assignments are essays…

Modal editor are not dated. You’re saying this as if the command line itself is dated. It’s not, casual user can go ahead and use Windows or Mac, but shell and she’ll editors will not in the foreseeable future be dated.

Re: How to Exit Vim

#310
post #53
post #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

Ugh, ps|grep is unnecessary. Just use pgrep! Or even better, pkill -9 ;-)

I started using Linux in 1997 and just today I've found out about pgrep and, on reddit, sudo !!

What a day!

Post reply on HN