Live data from Hacker News

Helping a Million Developers Exit Vim

stackoverflow.blog

191–200 of 489 posts

Re: Helping a Million Developers Exit Vim

#191
post #97

Earlier quoted context omitted.

If you took the modal interface away from vim, you wouldn't have vim anymore. If you don't want a modal interface, don't use vim. You may as well expect Porsche to move the 911's engine to the front.

> If you took the modal interface away from vim, you wouldn't have vim anymore. If you don't want a modal interface, don't use vim. The vast majority of people don't use vim, so this "solution" has already been widely adopted. (Which in turn causes people who like vim to periodically wonder why more people don't use it.) The problem comes because there are scenarios where you don't have a choice as to which editor to…

SSHing into a server implies a basic level of technical competence. The user presumably already knows cd, mv, ls, and family. Why would expecting the user to know a touch of VIM be out of place?

That said, any server admin who for whatever reason allows people to SSH in (shared hosting maybe, university, file sharing) should have nano installed. Anything else is just cruel!:wq

Re: Helping a Million Developers Exit Vim

#192

I'm somewhat amazed but mostly amused that the Vim developers care so little about user experience that they continue to ignore that people have trouble with exiting their tool and refuse to adapt to a more expected convention for exiting it.

It's maybe impossible to create a tool that's relatively small, intuitive, and for experts. Vim is relatively small and for experts.

There's kind of a trend of tools that are bright and shiny, but not actually that good at their main purpose. You hit a plateau. We don't need more of these, we need more tools that are bold enough to be powerful, even if they're at first hard to learn.

Re: Helping a Million Developers Exit Vim

#193
post #180

Unfortunately that answer is wrong. The way they should have been taught is: ZQ - Quit without saving ZZ - Quit with saving

But :q and :quit does in fact quit the program. It's also the command I've been using for 20 years... Why do you think it's "wrong"?

Those are slower. ZQ is three keypresses. :q is four keypresses.

Re: Helping a Million Developers Exit Vim

#194
post #68
post #29

Earlier quoted context omitted.

dev: That just typed ':q' into the text area me: Hit escape first, then :q dev: Oh, then why doesn't say escape then :q me: welp

Another thing I've seen is the person reads the text as: "Type: quit to exit Vim" Since the colon is used a separator such as I used it above. Then they type "quit" and enter, which actually put them in insert mode recording "@u", with a 't' sitting in the text area.

Wait, this is how I got so stuck my first time in vim! It sets you up for a whole string of problems in a row:

- You enter an unfamiliar mode, immediately hit "^c".

- That prompts "Type :quit to exit Vim".

- You mistakenly type "quit". So now you're in insert mode with recording, as you said.

- You hit "^c" again, breaking out of insert mode, but you don't get the exit prompt like you did last time - the `recording` message blocks that no matter how much you hit "^c".

- Without the reference message to find your mistake, you maybe try "quit" again. 'q' now terminates recording, 'u' undoes your typing, and 'i' dumps you back into insert mode, leaving you with a text field of 't' again!

- At this point you maybe hit "^c" again. That'll drop you out of insert, but with text in the field vim no longer prompts you to quit. If you enter "^c" again it will prompt you, but you tried that during recording mode and it did nothing, so you don't expect aimless repetition to help anything!

At this point, you give up, google "quit vim" and discover that the colon was important. I'm pretty sure this madness if what I did the first time git for windows popped open vim as the default editor.

Re: Helping a Million Developers Exit Vim

#195

Earlier quoted context omitted.

> refuse to adapt to a more expected convention for exiting it. Which would be?

Control C.

Try that in less. Or Emacs. Or Nano. Or Pico. Or ed.

Doesn't work there, either. Most of those don't even offer advice on how to exit when you hit that combo, do they?

So, how is Ctrl-C the right answer then?

Re: Helping a Million Developers Exit Vim

#196

I barely use any Vim, but I'm more confused about there being some hidden complexity in exiting Vim that I'm not aware of. Isn't it just... [Esc] :wq ...or... [Esc] :q! ...depending if you want to save the current document or not?

It baffles me that it isn't just ^C like every other unix program.

If you press ^C, it tells you how to quit. As to why it doesn't just exit, a lot of beginners would probably expect ^C in a text editor to copy text.

Re: Helping a Million Developers Exit Vim

#197

Earlier quoted context omitted.

And worse vim is often the default EDITOR or software's fallback in case no EDITOR is set, so you get dropped into a vim edition buffer seemingly randomly.

I'm pretty sure that I've never seen any OS/Linux distribution set default EDITOR to vim. If EDITOR is set to vim, then someone must intentionally did that.

Right. Many programs react to an unset EDITOR variable by assuming vi though. This makes sense, of course, as virtually all systems are going to have some implementation of vi installed. Even the almighty ed tends to be missing from the default install of some recent Linux distributions.

Re: Helping a Million Developers Exit Vim

#198
post #140

I saw the bumper sticker ":w saves" and thought, to myself I wonder how many people "get" that. I suggested a long time ago that vi/vim bind ^C to exit. It currently is equivalent to 'esc' (it puts you into command mode if you aren't there and types the message "type :quit to exit Vim". I'd much rather it popped up 'exit vim? y/n?' and the next key would determine if you exited or not.

That looks more like emacs behavior though, vim rarely (never?) prompts the user for anything. You enter a command, you get a reaction (either an action like quits vim, or a message indicating something happened) -- which I personally prefer much more than getting annoying prompts.

You get a prompt if you try to exit and you haven't written the buffer to file

Re: Helping a Million Developers Exit Vim

#200
post #146

Earlier quoted context omitted.

Emacs is definitely difficult to exit from. The difference is emacs usually isn't the default/fallback EDITOR on the system, so you rarely get dropped into it unknowingly/unexpectedly.

Also: Emacs is rarely if ever used in the terminal today, and exiting it through the standard desktop protocol ([X], Ctrl-[Shift]-Q, Alt+F4, ...) always works.

We get so many people using it in terminals in #emacs. Obviously there's no way to know how many people are not using it in a terminal because they won't be asking GUI-specific questions. I and a few others do try to discourage the terminal users and nudge them towards the GUI which is more featureful, but some people really want to use a terminal at all costs.
Post reply on HN