Live data from Hacker News

Helping a Million Developers Exit Vim

stackoverflow.blog

271–280 of 489 posts

Re: Helping a Million Developers Exit Vim

#271
post #121

Earlier quoted context omitted.

I'll bet between the reflog and aliases you could do that.

How would you undo "git reflog expire"? How would you undo "git push origin -f"?

Well let me put the question back to you: can changes to git provide undo for literally every command?

Re: Helping a Million Developers Exit Vim

#272

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.

Since I switch between Mac OS X, Windows, and Linux hosts, accidentally typing ctrl-c when I meant to type cmd-c (copy outside of Terminal) isn't such an infrequent error. I'm thankful that ctrl-c isn't mapped to quit without saving.

Re: Helping a Million Developers Exit Vim

#273

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.

I try hard to train myself that ^[ is ESC, but of course only in situations where jj doesn't work. =)

Re: Helping a Million Developers Exit Vim

#274

Earlier quoted context omitted.

I work for a reservation systems company (a GDS) that is used by thousands of travel agencies. Of course, since the system was created 30 years ago, you were only able to create reservation with a text-based interface at the time, with short commands, inconsistent and complex flows to do some non-trivial things etc. So it's despised by newcomers because learning curve is steep. However, the company has been building…

Altea Amadeus. And all the three big GDS need to be thrown into a fire. "Oh you want to add a person to the PNR? Well tough luck! Not a use case we handle!"

You should see how Sabre handles email address with it's bizarre, limited, possibly 7bit character set from 1959.

In Sabre emails can be like 70 characters long. But periods count as two characters, as do underscores, and @ counts as four. I mean given the choice between period and cross of lorraine I know which I am choosing to include.

Re: Helping a Million Developers Exit Vim

#275

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.

So much whining on this thread... Want to quit vim? How's about: 1- Hit ctrl-z 2- Type "kill -9 %" 3- Hit enter Result: dead vim. Heck, dead anything that was previously on the foreground. This works with emacs, vi, nano, and, I guess pretty much everything, since ctrl-z is captured by the shell and never gets sent to the application (I think).

No, applications can and do trap either ^z or the signal it generates (not sure which). I'm a vi user [0] but I'm pretty sure emacs requires ^z^z to STOP.

[0] autocorrect lol of the day: "I'm a vi[rgin]"

Re: Helping a Million Developers Exit Vim

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

I suspect that sed -i (and before that perl -i) made ed even less relevant than before.

Re: Helping a Million Developers Exit Vim

#277

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 do consider that a misfeature, especially since Ctrl+W and Ctrl+A are one key away and often carry commonly-used commands.

Re: Helping a Million Developers Exit Vim

#278
post #180

Earlier quoted context omitted.

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.

Psh. Map ; to :, git gud.

Re: Helping a Million Developers Exit Vim

#279

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.

Well, and my GUI editors don't respond to single-letter commands. It would violate my expectations of their UIs if they did. Similarly, in vim, I expect ctrl+q to send an XON signal to my terminal emulator...not to quit my editor.

They're different programs with different UI conventions. I don't expect them to act the same. And I especially don't expect vim to change, after having 25 years of its own precedent and an additional 16 through vi.

Re: Helping a Million Developers Exit Vim

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

> So it actually doesn't It does, it just does not care. > it's basically just a hack around the fact that the repl is basically: I know what a REPL is. Here's an idea: it's not difficult to add an exit special case to the REPL. > Case in point: Case in point: the developers added a "help text" to tell users to go fuck themselves, knowing exactly what users wanted to do and refusing to do it. quit's repr didn't appea…

quit is not a piece of repl functionality, it is a python function that will exit the repl when called, with a string representation that gives that message. If I set quit = 1, or if I define my own quit() function, I don't want to have to be continually fighting the repl in order to inspect its value.
Post reply on HN