Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My "favorite" thing is when you hit Ctrl-C, and Vim says "Type :quit<Enter> to exit Vim". Vim isn't dumb. It knows what Ctrl-C means, it knows what you wanted to happen. But it's gonna make you do it its way anyway, because fuck you.


Actually, that's a feature... Ctrl-C exits insert mode. If it quit vim when in Normal mode, you'd accidentally quit Vim all the time. Less annoying to just show a helpful message in case you actually meant quit, than dump everyone who knows what Ctrl-C does back to a shell.


I think more important than exiting insert mode is (as I described in a peer comment, hopefully clearly) killing foreground processes you've spawned out of vim. 1) With exiting insert mode there's the option of using escape instead (or capslock or jk or whatever people bind it to), and 2), I think most importantly, with killing processes there's an actual race condition: if the command finishes after I decide to kill it and before vim registers my Ctrl-c, exiting is totally the wrong thing to do.


I would think that it's because ViM wants you to learn something about how the it works.

If it just exited with Ctrl-C, you'd never get to know about the : magic.

Not to mention Ctrl-C is ambiguous. What to do: Exit and save? Exit without saving? What if it's a new file? And probably others I'm not thinking about right now.


Much like Python

    Python 2.7.9 (default, Mar  1 2015, 12:57:24) 
    [GCC 4.9.2] on linux2
    Type "help", "copyright", "credits" or "license" for  more information.
    >>> quit
    Use quit() or Ctrl-D (i.e. EOF) to exit
    >>>


thats because you don't want to be using a variable quit and have it suddenly exit.


Definitely a feature not a bug.

    :'a,'b!longrunningcommand
oh, wait, that was not the right thing...

    C-<longrunningcommand finishes>c




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: