Live data from Hacker News

Helping a Million Developers Exit Vim

stackoverflow.blog

121–130 of 489 posts

Re: Helping a Million Developers Exit Vim

#121

Earlier quoted context omitted.

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

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"?

Re: Helping a Million Developers Exit Vim

#122

That's funny because I feel that exiting vim is easy. On the other hand, exiting from nano is a nightmare and makes no sense to me - To make matters worse, it's difficult to find info online because it's hard to explain nano's confusing interface with keywords. I hate how git made nano the default editor on Ubuntu. Every time I install git, I have to remember to change the configs to use vim as the default.

Maybe I've taken some crazy pills recently but I thought nano displayed the hotkey to exit on the screen.

Re: Helping a Million Developers Exit Vim

#123
post #18

Earlier quoted context omitted.

No, it really is that easy. If you try to -c, the program even tells you to use :q It's just become a meme at this point.

> If you try to -c, the program even tells you to use :q And then you do and it helpfully adds ":q" to the buffer. You're still in vim.

If you hit ctrl-c then you are no longer in insert mode (ctrl-c acts like esc for some reason), so no, it won't add anything to the buffer and ":q" will get you out.

I don't blame people for being confused though.. I remember getting stuck in vim all the time back in the day because of a default $EDITOR value.

Re: Helping a Million Developers Exit Vim

#125
post #85
post #55

Earlier quoted context omitted.

Cute, but no. When you enter insert mode, the "welcome screen" disappears. So if you can see the instruction telling you to type ':quit', then typing :quit will work.

FTA, https://zgab33vy595fw5zq-zippykid.netdna-ssl.com/wp-content/... It happens because people don't what they are doing. You assume that they hit ctrl+c, then immediately type :quit, but if they did, then they wouldn't be Googling it. They did something between trying to exit and quit that got them into a different mode.

I'm not assuming they're hitting Ctrl+C.

What I'm saying is the screen that says

                               VIM - Vi IMproved                                
                                                                                
                                version 8.0.567                                 
                            by Bram Moolenaar et al.                            
                  Vim is open source and freely distributable                   
                                                                                
                            Sponsor Vim development!                            
                 type  :help sponsor    for information                  
                                                                                
                 type  :q               to exit                          
                 type  :help  or    for on-line help                 
                 type  :help macvim     for MacVim help
disappears as soon as you enter insert mode (or really interact with Vim at all). If you're in insert mode, you don't see this. So if you see this, typing :quit will work.

Re: Helping a Million Developers Exit Vim

#127
post #100

> It looks like developers in Ukraine, Turkey and Indonesia are getting stuck in Vim quite a bit: it makes up a larger portion of their Vim questions than in any other country. In contrast, in China, Korea and Japan the fraction going to this question is a tenth smaller. From my experience, people at least from Korea are very likely to develop on windows, even when targeting linux or even embedded linux. You can tell…

IIRC, they had regulations about banking security that mandated some IE6 ActiveX plugin. They are just now, or just have, coming around to changing that.

Re: Helping a Million Developers Exit Vim

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

Awk is probably the most powerful "taken for granted" utility in all of the unix ecosystem.

Re: Helping a Million Developers Exit Vim

#129
post #23

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?

I think mostly it's people not being familiar with escape key. If you think about it, pretty rare you use Escape in anything other than a game..

On the Mac, the escape key has been used forever in dialogs as a surrogate for the Cancel button or for dismissing dialogs where the results are non-destructive.
Post reply on HN