News for hackers. Stuff that matters.
Re:Helping a Million Developers Exit Vim by dsp1234 on Tuesday May 23, 2017 @01:49PM (#14403393)
dev: That just typed ':q' into the text area

me: Hit escape first, then :q

dev: Oh, then why doesn't say escape then :q

me: welp

Re:Helping a Million Developers Exit Vim by dsp1234 on Tuesday May 23, 2017 @01:59PM (#14403511)
Another thing I've seen is the person reads the text as:

"Type: quit<enter> to exit Vim"

Since the colon is used a separator such as I used it above.

Then they type "quit" and enter, which actually put them in insert mode recording "@u", with a 't' sitting in the text area.

Re:Helping a Million Developers Exit Vim by Bartweiss on Tuesday May 23, 2017 @02:50PM (#14404048)
Wait, this is how I got so stuck my first time in vim! It sets you up for a whole string of problems in a row:

- You enter an unfamiliar mode, immediately hit "^c".

- That prompts "Type :quit<enter> to exit Vim".

- You mistakenly type "quit<enter>". So now you're in insert mode with recording, as you said.

- You hit "^c" again, breaking out of insert mode, but you don't get the exit prompt like you did last time - the `recording` message blocks that no matter how much you hit "^c".

- Without the reference message to find your mistake, you maybe try "quit<enter>" again. 'q' now terminates recording, 'u' undoes your typing, and 'i' dumps you back into insert mode, leaving you with a text field of 't' again!

- At this point you maybe hit "^c" again. That'll drop you out of insert, but with text in the field vim no longer prompts you to quit. If you enter "^c" again it will prompt you, but you tried that during recording mode and it did nothing, so you don't expect aimless repetition to help anything!

At this point, you give up, google "quit vim" and discover that the colon was important. I'm pretty sure this madness if what I did the first time git for windows popped open vim as the default editor.

Re:Helping a Million Developers Exit Vim by binarycrusader on Tuesday May 23, 2017 @02:05PM (#14403583)
Except, if you hit Ctrl+C, you don't have to hit ESC. You literally type what it tells you and it works.

The only way the above would work as suggested is if the person hit an insert mode key first after having typed Ctrl+C.

Re:Helping a Million Developers Exit Vim by YeGoblynQueenne on Tuesday May 23, 2017 @03:19PM (#14404304)
Weelll. The problem is that the "quit" command has an insert mode key in it. So it's quite possible to get stuck like a poster above says- enter macro recording, then insert mode, then write the letter "t".

On the other hand that only happens if you type "quit" without the colon and the message makes it very clear that the colon is part of the text you must enter:

  Type  :quit<Enter>  to exit Vim
See all that whitespace? It's very hard to think the colon goes to the "Type" bit.

So you can get stuck in a dubm situation but it's not terribly easy.

Re:Helping a Million Developers Exit Vim by binarycrusader on Wednesday May 24, 2017 @02:09PM (#14412133)
See all that whitespace? It's very hard to think the colon goes to the "Type" bit.

Except, logically, why would they bother to specially call out <Enter>, a whitespace character, but not the spaces as well if they intended the user to type them?

I can't think of any obvious, safe way to display text that a user should type that isn't subject to possible misinterpretation in the single line of output available.

Re:Helping a Million Developers Exit Vim by YeGoblynQueenne on Thursday May 25, 2017 @10:45AM (#14417614)
Alright, but if we're being so scholastic it should be said that you can misinterpret any set of instructions and in this case, squinting at the command line a couple of times to make sure you got the command right is all it should take you to get it right.
Re:Helping a Million Developers Exit Vim by eridius on Tuesday May 23, 2017 @01:56PM (#14403477)
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.
Re:Helping a Million Developers Exit Vim by dsp1234 on Tuesday May 23, 2017 @02:02PM (#14403548)
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.

Re:Helping a Million Developers Exit Vim by eridius on Tuesday May 23, 2017 @02:18PM (#14403729)
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<Enter>    for information                  
                                                                                
                 type  :q<Enter>               to exit                          
                 type  :help<Enter>  or  <F1>  for on-line help                 
                 type  :help macvim<Enter>     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 by dsp1234 on Tuesday May 23, 2017 @02:32PM (#14403872)
Of course, yes. The above commenter mentioned insert mode and ctrl+c which is why I was missing that you particularly were talking about this one screen.
Re:Helping a Million Developers Exit Vim by FreeFull on Tuesday May 23, 2017 @02:08PM (#14403632)
Perhaps they miss the : Without it, you end up recording a macro and going into insert mode.
Re:Helping a Million Developers Exit Vim by StavrosK on Tuesday May 23, 2017 @02:10PM (#14403640)
Even if you're in insert mode, ctrl-c takes you to normal mode, then a second press will show you the hint.