Live data from Hacker News

Helping a Million Developers Exit Vim

stackoverflow.blog

201–210 of 489 posts

Re: Helping a Million Developers Exit Vim

#201

Earlier quoted context omitted.

That's the point. That behavior is contrary to the expectation. Ctrl+C should not display a message: Ctrl+C should quit immediately.

Coming from the Windows world, I am happy that Ctrl+C doesn't make assumptions and quit. Imagine attempting to copy something and having your file close without warning.

You can intercept Ctrl+C on Windows just as well and do nothing, or something different than quitting.

Re: Helping a Million Developers Exit Vim

#202

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.

Vim is a modal [1] editor that runs in a console. From those two points onwards you're already a few orders of semantic magnitude away from "more expected convention(s)" so there's really no point trying to fit it into a context it was never meant to fit in the first place.

____________

[1] As in command and edit modes.

Re: Helping a Million Developers Exit Vim

#203
post #76

When I told my thesis advisor (in about 2001) that I was looking into backend web development as a career, he gave me a post-it note with the following content: chmod 0644 [Esc] :wq Best advice I've ever gotten.

Yes, please do chmod your SSH key, netrc, and other sensitive files as world readable! Sincerely, that other guy on your multi-user OS.

chmod 0644 is indeed bad advice in ~/.netrc. Similarly, [Esc] :wq is not too helpful at a bash prompt. If you don't know the difference you're not yet ready for the magic post-it note.

Re: Helping a Million Developers Exit Vim

#204

Earlier quoted context omitted.

That's the point. That behavior is contrary to the expectation. Ctrl+C should not display a message: Ctrl+C should quit immediately.

On many editors ctrl-c is the copy key. Not a good key to exit on...

CTL-C, or CMD-C?

Re: Helping a Million Developers Exit Vim

#205

Earlier quoted context omitted.

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

I'm requesting the exact syntax I just wrote. EDIT: the replies to this don't get how feature requests work. yes, I could write this basic feature myself. thanks.

You can make a bash script named `git-undo` , put it in your path (I use ~/bin):

    #! /bin/bash
    git reset HEAD~1 && git checkout .

Re: Helping a Million Developers Exit Vim

#206
post #168

Earlier quoted context omitted.

On many editors ctrl-c is the copy key. Not a good key to exit on...

It's the other way around - mapping copy to ctrl-c was a bit stupid...

Yep. Apple got this one right with the Cmd key. Much saner than the context-dependent hijacking of the control key with its long-established conventional usage.

Re: Helping a Million Developers Exit Vim

#208
post #47

Earlier quoted context omitted.

I think this is a poor argument. If it's the one singular thing that's frustrating this many users, that's a reason to focus on particular on fixing it somehow. You also need to take into account that most users encountering this problem are not deliberate vim learners: they ended up in vim by accident. That said, as others have pointed out, the vim developers can't really be blamed here as it's just a very hard prob…

>they ended up in vim by accident. Sounds like a distro problem.

Technically a distro problem but since most Linuxes I've used default to nano I'm guessing the most common culprit is the msysgit "distro".

macOS is another potential culprit - can't remember the default there.

Re: Helping a Million Developers Exit Vim

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

Only works for commits, but it's a very useful alias I've picked up.

    [alias]
        undo = reset HEAD~1 --mixed

Re: Helping a Million Developers Exit Vim

#210
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…

Humane programming is something I wish compiler and language builders would do more of
Post reply on HN