Live data from Hacker News

How to Exit Vim

github.com

341–350 of 409 posts

Re: How to Exit Vim

#341

I first gained access to a UNIXish system in the fall of 1988, which was some SunOS4.x variant I believe. The shell was csh, the editor was vi, and I had no idea what I was doing, nor was there any help in my immediate area to be found. And no, I didn't know about 'man' yet. Somehow I discovered that 'vi' was the way to edit things, but I didn't know how to exit, so trial and error led me to pressing control and z at…

Similar experience, except a ATT 3B2 (and thus no job control). I would have read the man page, but there were none, nor were any books available. I finally just pulled the plug out of the wall. It's not much of an exaggeration to say that I became a lifelong emacs user because the start screen even back then explained how to exit.

Wait really? I'm a lifelong emacs user too[0] but it only tells you how to exit if you open it without a filepath. If you're in a file because EDITOR was set to emacs by some other person and you try to exit it just says "C-c" or "C-c C-c is undefined" when it should just tell you how to exit. Or even better why doesn't it just exit on "C-c C-c"?

[0] Well I might write my own emacs-inspired, ruby enabled editor one day, but that's another story.

Re: How to Exit Vim

#342

Earlier quoted context omitted.

Similar experience, except a ATT 3B2 (and thus no job control). I would have read the man page, but there were none, nor were any books available. I finally just pulled the plug out of the wall. It's not much of an exaggeration to say that I became a lifelong emacs user because the start screen even back then explained how to exit.

Holy shit, ATT 3B2, I haven't heard any mention of those in a long time. So, six years later, in 1994, I found myself as the UNIX system administrator for a large (at the time) datacenter at Keesler Regional Medical Center, Keesler AFB, Biloxi Mississippi, where we had quite a number of 3B2s. They were, in fact, the only machines we had that were rated for classified data. If memory serves, they ran AT&T System V rel…

For what it's worth, I also used DG/UX, MV/UX and AOS/VS on Data General equipment (MV/10000, MV/4000) at the University of Washington in the 1985ish time-frame.

I remember porting many BSD 4.x utilities to MV/UX. What a learning experience, with the MVs differently-formatted byte vs. word pointers.

The C compiler was really nice, though.

Fun times.

Re: How to Exit Vim

#343

Earlier quoted context omitted.

That's good advice, but in all practical situations I have been able to use Vim directly or know enough vi to get by, though I am much less comfortable with it. I don't touch type, so hjkl, even though I understand the benefits, has never been my preference. Perhaps it's the gamer in me, I've never had trouble using the arrow keys :)

As far as I know, hjkl was first introduced in games and later used in vim because we don't have to move our hands far away from the keys. Feel free to correct me If I'm wrong.

https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys

Re: How to Exit Vim

#344
post #36

It's amazing to think how far we've come since June 2018 where the record was just shy of three minutes ( https://www.youtube.com/watch?v=TLbfqZBL8t8 ). These new strategies could allow experienced speedrunners to exit vim in times of 10 seconds (or perhaps less!?). I'm excited to see how this progresses, the vim speedrun community is vibrant and creative and I've no doubt we'll see a sub 5-second run within my lifet…

I'm curious if there is any work in fuzzing that could be applied here.

Re: How to Exit Vim

#345
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.

Look at it this way: maybe this show of insanity could cause further frustration and ideally help newcomers realize that avoiding vim altogether can be preferable for their future.

Sarcasm aside, I fully agree with you.

Re: How to Exit Vim

#346
post #135

Jokes aside, shouldn't the page start with actually teaching how to quit vim? The page is considerably popular to show up on a Google search. I imagine the frustration of a beginner actually trying the first examples and not getting the joke immediately.

I'd bet that most people who get stuck don't start vim themselves though. I taught (the basics of) git to a bunch of students recently and the first time we did a commit I had to go around the room and show people how to operate vim. I bet the same happens when new people use visudo, etc

This is why vim is a bad default. Thankfully, there's someone thinking about changing this [0].

[0] https://www.phoronix.com/scan.php?page=news_item&px=Fedora-W...

Re: How to Exit Vim

#347

Earlier quoted context omitted.

I don't understand the logic there. In what non-contrived scenario would you run both simultaneously, such that they would conflict? C-a does annoyingly conflict with readline's "move to start of line", though.

Hitting C-a twice sends it to the terminal.

Close... "C-a a" sends a real "C-a", while "C-a C-a" swaps with your most recent window (it's fast and convenient to type).

Re: How to Exit Vim

#348

Earlier quoted context omitted.

Similar experience, except a ATT 3B2 (and thus no job control). I would have read the man page, but there were none, nor were any books available. I finally just pulled the plug out of the wall. It's not much of an exaggeration to say that I became a lifelong emacs user because the start screen even back then explained how to exit.

Wait really? I'm a lifelong emacs user too[0] but it only tells you how to exit if you open it without a filepath. If you're in a file because EDITOR was set to emacs by some other person and you try to exit it just says "C-c" or "C-c C-c is undefined" when it should just tell you how to exit. Or even better why doesn't it just exit on "C-c C-c"? [0] Well I might write my own emacs-inspired, ruby enabled editor one d…

That's true. If you tried Control-H, you'd get a lead. Unless of course that was mapped to your main backspace key, which sometime happened in the bad old days.

As to why Control-C doesn't just exit the editor, I suppose it was generally considered to be a bad idea. And in the case of emacs, it might take five or ten minutes to restart. :-)

(It's worth noting also that GNU emacs ran on many platforms, some of which for which Control-C was not any kind of "kill my process" character.)

Re: How to Exit Vim

#349
post #107

Great jokes but bad user interface design comes at a real cost.

From perspective of ASCII-only application, vim interface isn't actually bad, it just lacks discoverability. There is also a real cost to making tool beginner-friendly and it often makes sense to optimize for advanced users instead.

An interface lacking discoverability is a bad interface.

Re: How to Exit Vim

#350

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…

I suspect the rationale is that, depending on the language you're using, some IDEs "help" with coding to the point where they're correcting your mistakes and even writing parts of your code for you. This is pretty much a selling point for everything JetBrains makes, and arguably even Visual Studio Code rubs against the edge of that if you're using a language that's well-supported by IntelliSense. The central thrust of the course is presumably how to write code yourself, and the case could be made that learning with an editor designed to routinely save you from yourself isn't going to be as good as an editor which, well, isn't.

(This is setting aside the argument as to whether Vim is a "dated" editor. Vim is an old editor, to be sure, but forget WordPerfect -- it's not as old as Microsoft Word is!)

Post reply on HN