5 ms·
I never understood why people like to joke to about not being able to quit vim. When you launch vim, it literally tells you how in the most clear way possible:
by soraminazuki 6y ago
I never understood why people like to joke to about not being able to quit vim. When you launch vim, it literally tells you how in the most clear way possible:
type :q<Enter> to exit
- kalioz 6y agoIt does when you open vim without arguments, not when vim opens directly a file, in which case it's confusing to beginners
- soraminazuki 6y agoAh yes, I forgot about that. But I'm kind of skeptical that complete beginners would start poking around vim by opening a file directly though.
- werid 6y agowhen it's the default editor and you go to add a cron job...
- soraminazuki 6y agoYou've definitely got a point.
- MAGZine 6y agoDoesn't ctrl/cmd-c remind you of the exit sequence?
- rezonant 6y agoYes it does! But how will they know to hit Ctrl+C? /s
- jabirali 6y agoThe "obvious" reason would be if a person is used to terminals but not vim, as ctrl-c usually kills processes. I think a lot of confusion could be avoided if distributions like Ubuntu, that are commonly used by new Linux users, were to set e.g. EDITOR=nano in their default ~/.bashrc. That way, writing "git commit" from a terminal, typing "v" inside less, etc. would all bring up nano instead of vim by default.
- rezonant 6y ago/s means "sarcasm" :-)
- YeGoblynQueenne 6y agoFrom the git documentation: *core.editor* *By default, Git uses whatever you’ve set as your default text editor via one of the shell environment variables VISUAL or EDITOR, or else falls back to the vi editor to create and edit your commit and tag messages* https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration It seems that many people leave their default editor undefined so git opens vi for commit messages by default. vi tends to be symlinked to vim on many systems so that means they end up in vim (not that it makes a difference, I'm just being pedantic :).
- lordgrenville 6y agoYeah, I think the most common case is git beginners typing `git commit` without the -m flag. This was my first (unwilling) baptism into Vim.
- recursive 6y agoUg yes. This is why I always pass -m to commit, at the risk of losing the containing terminal session to forcible closure. I know quitting it is colon exclamation something or other, but it's always quicker just to start from scratch than to look it up.
- deanclatworthy 6y agoAs a complete vim beginner this is what I did and still do. I have never opened it fresh as I don't know how to then open a file :D
- deleted 6y ago[deleted]
- alpaca128 6y agoVim also writes a help message when Ctrl-C is pressed, in case someone desperately tries to stop it like any other terminal command.
- jamesrcole 6y agoThey might have pressed some keys as soon as they opened Vim causing that message to disappear before they got to read it. Or they might have been working on a file for hours before they want to quit it, so might not remember. Or, they might not know how to enter :q. Entering it requires them to be in the right mode. (I say this as someone who's used Vim for a number of years).
- innocenat 6y agoI doubt you would be working on a file for hours if you don't know how to use Vim. I doubt Vim killer save the file for you either.
- jabirali 6y agoThey should have advertised on startup that you can press F1 to bring up help (in both vim and nvim), that's probably easier to remember for people coming from GUI editors.
- fit2rule 6y agoI remember the rage I felt when I saw a junior dev use "Ctrl-Z .. kill %1" to get out of vim one time, only to be told that he 'thought it was Z something-or-other'. Its 'ZZ', kid. Or ":q!" if you don't wanna save your mods ..
- innocenat 6y agoI must have used it a couple of time when I was starting to use vim lol. Ctrl-Z, killall -9 vim.
- skocznymroczny 6y agoI do Ctrl+Alt+F1, log in and kill from there :s
- eddieoz 6y agoit should be: to Exit: type <ESC> type :q!<Enter>
- me_me_me 6y agoYou are using Linux at this point, if you cannot figure this out, then good luck with anything else ;p
- logicchains 6y agoNot if you're innocently browsing a file in less, accidentally hit `v` instead of `ctrl v`, and suddenly find yourself in Vi, possibly now in some weird mode due to the other keys you just pressed under the assumption you're still in less.
- aargh_aargh 6y agoOMG, how am I only now learning about this life-changing feature? I need to read man less again.
- logicchains 6y ago>OMG, how am I only now learning about this life-changing feature? Ironically you might have learned about it sooner by using Emacs more, because then you'd be more likely to use the ctrl-v Emacs hotkey for scrolling down fast (which also works in less) and mispress it.
- t0astbread 6y ago*You need to read man less more
- ornornor 6y agoNeat, didn’t know about v! But on my system (Ubuntu 18.04), Ctrl-v doesn’t do anything. What’s it for?
- logicchains 6y agoScroll down one page; it's an Emacs hotkey.
- deleted 6y ago[deleted]
- dntbnmpls 6y agoYou forgot our friend <Esc>. Otherwise, those in insert mode will be stuck in limbo forever. Some say vim was created to give us an excuse to hit <Esc> over and over again.
- BearOso 6y agoYou didn't elaborate that <Esc> is a modifier key. So if they've hit <Esc> and are still within the timeout window, it'll think they've hit <Esc>-Whatever, not <Esc> alone. Best hit it twice, or three times to be sure.
- ezoe 6y agoAnd if you miss that, if you press Ctrl-C, vim display the proper way to quit vim from ages ago.