Live data from Hacker News

Helping a Million Developers Exit Vim

stackoverflow.blog

261–270 of 489 posts

Re: Helping a Million Developers Exit Vim

#261

The last graph shows, of people who get stuck in vim what language they use the most. This means this could just be a graph of the most used programming languages. eg if there is a uniform 10% probability that anyone will get stuck in vim. I would find it interesting to see a graph that show what percent of each language's users get stuck in vim.

The latter is indeed what that graph is showing: what percentage of each language's users get stuck in Vim (or more precisely what % of their Vim visits are to that question). It's not being confused with the most used programming languages.

Ah, excellent!

Re: Helping a Million Developers Exit Vim

#262

Earlier quoted context omitted.

Because it's an editor, and if it just quit on me every time I mistyped Ctrl-C just because you can't be bothered to type the right command, I would be quite angry.

My GUI editors quit on me every time I mistype Ctrl+Q. I don't really see the difference.

I would think that in both the ^Q and ^C case, the editor in question is capable of prompting "Really exit? (Y/n)" or something to that effect.

Re: Helping a Million Developers Exit Vim

#263
post #3

Obviously my personal bias, but it's emacs I can never remember how to exit from.

I'll first admit I'm a worshiper of the Church of Emacs.

I told the trying to exit vi joke for years until someone pointed out to me that C-x C-c was equally if not more obscure. It was a part of me because that was the first thing I ever learned about Emacs. Just like :wq was the first thing I ever learned about vi.

Now, I think the fact that people seem to have more difficulty exiting vi is because vi is very likely the fallback for $VISUAL/$EDITOR, and hence much more likely to be trapped in by accident when unprepared.

Re: Helping a Million Developers Exit Vim

#264
post #198
post #140

Earlier quoted context omitted.

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

It does print a message, but doesn't prompt you for a response. I think that's the distinction that was being made.

Re: Helping a Million Developers Exit Vim

#265

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.

I'd vote against that. I use ^C as the best "esc-replacement-without-straying-far-from-the-home-row" that works in every install, every emulator and every international keyboard.

Re: Helping a Million Developers Exit Vim

#266
Why should we encourage exiting?

Perhaps the mission is not complete and you should keep the file open until there are zero defects, everything is properly commented and you 100% understand everything and then some.

At that point _maybe_ Vim shall let you exit!

:)

Re: Helping a Million Developers Exit Vim

#267
post #156
post #95

Earlier quoted context omitted.

So it actually doesn't, it's basically just a hack around the fact that the repl is basically: while True: print(str(eval(input()))) Case in point: >>> x = str(quit) >>> x 'Use quit() or Ctrl-Z plus Return to exit' I suppose you could implement quit.__str__ as sys.exit(0), if you really wanted to avoid this problem.

Whatever logic currently used to print the 'Use quit() or Ctrl-Z plus Return to exit' message could also... quit the REPL in the first place, right? I don't program Python much but do its users constantly type "quit" but not actually want to quit such that the REPL special cases this situation?

There is no special logic behind it. It just prints the value of the variable with the name "quit", the same way it would print the value of the variable "foo" if you typed "foo".

Re: Helping a Million Developers Exit Vim

#268
post #90

(Attribution is questionable, but as a geezer I feel the need to make sure the younger generations at least are familiar with this:) ed is the standard text editor Let's look at a typical novice's session with the mighty ed: golem> ed ? help ? ? ? quit ? exit ? bye ? hello? ? eat flaming death ? ^C ? ^C ? ^D ? --- Note the consistent user interface and error reportage. Ed is generous enough to flag errors, yet pruden…

I find that with a specific and known edit, it's far easier to do using sed and awk. In particular awk Has better power-to-weight ratio at traditional text processing. I think typical awk scripts could very well be shorter than the equivalent python scripts that do the same thing.

Next you're going to tell us 1+1=2!

Re: Helping a Million Developers Exit Vim

#269
post #7

The most viewed question is even more relatable: https://stackoverflow.com/questions/927358/how-to-undo-last-... You can get the top viewed questions here: http://data.stackexchange.com/stackoverflow/query/53109/ques...

hey Linus, undo last 1 git command (as though it had never been entered): git undo 1 thanks.

How about git uncommit? Undo suggests it might work for other actions like pushing

Re: Helping a Million Developers Exit Vim

#270
post #140

Earlier quoted context omitted.

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.

I don't disagree. And I like that vim doesn't prompt you a lot, but it is the one corner case where such prompting could be useful.

it already tells you hot to quit when you hit control-c and if you happen to be in edit mode, hitting it twice gets you the message.

if people don't notice the "Type :quit to exit Vim" message, they also won't see the (Y/N) selection.

so, absolutely nothing gained by making this change, except making things more annoying for people who do know how to use vim.

Post reply on HN