27 ms·
Helping a Million Developers Exit Vim
- swetabhsuman8 9y agoFull Concept Of Jailbreaking | Pros & Cons Of Jailbreaking http://hackernucleus.com/full-concept-of-jailbreaking-pros-cons-of-jailbreaking/ http://hackernucleus.com/full-concept-of-jailbreaking-pros-c...
- doktrin 9y agoObviously my personal bias, but it's emacs I can never remember how to exit from.
- oefrha 9y agoI'll first admit I'm a worshiper of the Church of Emacs. I told the trying to exit vi joke for years until someone pointed out to me that C-x C-c was equally if not more obscure. It was a part of me because that was the first thing I ever learned about Emacs. Just like :wq was the first thing I ever learned about vi. Now, I think the fact that people seem to have more difficulty exiting vi is because vi is very likely the fallback for $VISUAL/$EDITOR, and hence much more likely to be trapped in by accident when unprepared.
- cryptoz 9y agoMe too. I once helped organize talks at my school, and helped with bringing Richard Stallman to give a talk one time. I was a vim user, but I did a little bit of prep and refreshed my emacs memory etc. So we're setting up the room for the talk, and we're talking a bit, and some people start to arrive. He asks one if they've ever used emacs, she says no, so I said, "we should start an emacs tutorial here, we can teach everyone about things like C-x C-c, and stuff". I just blurted out the only thing I had remembered recently. He turned a cold shoulder to me, I suppose thinking that I had insulted him directly. I ran out to Google what I had said, and then felt terrible about it, but it was too late. That's my remembering how to quit emacs story.
- weaksauce 9y agoIt was probably because he knew what OS license you'd try to use.
- kazinator 9y agoHmm, it might have just been because "things like C-x C-c and stuff" sounds kind of dumb, not because it refers to quitting Emacs. Like imagine: B. Kernighan: have you ever used Unix? Student: No. You: Hey, how about we start a Unix tutorial here; we can learn all about dollar-sign-1, and stuff. B. Kernighan: * roll eyes * :)
- groby_b 9y agoC-M-footpedal1-q
- NTDF9 9y agoYou got it wrong! It's more like: C-M-handstand-q-footpedal
- digi_owl 9y agoC-M-guru-meditate https://en.wikipedia.org/wiki/Joyboard https://en.wikipedia.org/wiki/Joyboard
- flavio81 9y agoI seriously would like to have a pedalboard with, say, 5 pedals that i could map to specific functions on Emacs. It would be terrific, particularly for Lisp development with SLIME.
- kazinator 9y agoHmm. MIDI foot controller -> USB MIDI interface -> computer -> driver -> user space scriptology ... What do you think? That would easily give you ten pedals. I use a 1993 vintage ART Ultrafoot X-15 I got off Craigslist --- for my guitar rig, not a text editor. :) https://www.google.ca/search?q=ART+Ultrafoot+x-15&tbm=isch https://www.google.ca/search?q=ART+Ultrafoot+x-15&tbm=isch
- misingnoglic 9y agoWhy not just play the piano for programming?
- kazinator 9y agoA MIDI foot controller isn't a musical keyboard (though such things do exist, mimicing organ pedals). It's used for MIDI program changes. I have a MIDI programmable guitar pre-amp, and so in combination with this pedal, I have access to various amp settings just by stepping on various buttons.
- d0mine 9y agoThe command is: M-x kill-emacs (or to save buffers before the exit: M-x save-buffers-kill-emacs). Perhaps, exit-emacs or quit-emacs aliases could be defined.
- Symbiote 9y agoControl X-C
- marcosdumay 9y agoIt's quite hard to get emacs to open for you when you don't want it. Harder still to get it without a GUI. Overall, both are about as hard to deal with. Vim has a better help message, but it's still difficult to find.
- Bartweiss 9y agoYep - I suspect people are less likely to stumble into emacs without any warning.
- throwaway2016a 9y agoMy anecdotal experience has been that no matter how many times I'm told how to exit Emacs I can't remember but every developer I have taught '<esc>:wq' to has remembered it after one or two times telling them what it is.
- omni 9y ago(kill-emacs) C-x C-e Pretty straightforward.
- doktrin 9y ago> (kill-emacs) C-x C-e > Pretty straightforward If this is a joke, it's totally whooshing over my head right now
- omni 9y agoC-x C-e evaluates the Emacs Lisp expression before the point. This gives the same result as the much more obvious M-x kill-emacs, but with the added fun of writing and executing Lisp directly in whatever buffer you're in. So to close the editor, we've written some code in a weird ancient language into some random text file, fired up an interpreter that's probably so portable you can run it on a 1980s toaster, and executed an expression which we had to make sure was wrapped in those vile parentheses everyone loves to hate. Straightforward. But I just had to explain my own joke, so I'll go wallow in shame for the rest of the day. :(
- doktrin 9y agoNo don't feel bad! It's a good joke I was just sleepy when I responded :)
- masklinn 9y agoEmacs is definitely difficult to exit from. The difference is emacs usually isn't the default/fallback EDITOR on the system, so you rarely get dropped into it unknowingly/unexpectedly.
- dom0 9y agoAlso: Emacs is rarely if ever used in the terminal today, and exiting it through the standard desktop protocol ([X], Ctrl-[Shift]-Q, Alt+F4, ...) always works.
- jordigh 9y agoWe get so many people using it in terminals in #emacs. Obviously there's no way to know how many people are not using it in a terminal because they won't be asking GUI-specific questions. I and a few others do try to discourage the terminal users and nudge them towards the GUI which is more featureful, but some people really want to use a terminal at all costs.
- FullyFunctional 9y agoI don't think that's true. System administrators will happily use it in a terminal. I'd often deliberately run emacs -nw when something requires a quick edit and the GUI would be imposing.
- ams6110 9y agoI use emacs in a terminal all the time (usually in a tmux session, actually). That's how I learned it (in pre-GUI days) and so it feels pretty natural. I never use the mouse with emacs, even in a GUI session.
- masklinn 9y agoNote that GUI emacs doesn't mean using a mouse. I use GUI emacs but almost never interact with it with a mouse, I just have a server-enabled emacs running fullscreen in one of my virtual desktops.
- TeMPOraL 9y agoC-x C-c. It's too easy to hit accidentally, though. I got burned by it a few times, so I eventually unbound the command. I now use M-x kill-emacs when I want to quit (very rarely, anyway).
- falcolas 9y agoCmd-T killall emacs ;)
- JdeBP 9y agoWhat you want is a handy WWW page to refer to. * http://jdebp.eu./Humour/exiting-emacs.html http://jdebp.eu./Humour/exiting-emacs.html
- ben_jones 9y agoIsn't that exclusively used by middle aged computer scientists?
- mehrzad 9y agoThere has been a resurgence of use since the popularity of Spacemacs, and I know several of my peers around my age (20) who use Emacs, including myself.
- jaredsohn 9y agoEven if it is, I don't see the relevance of this comment.
- deleted 9y ago[deleted]
- coldtea 9y agoYes, it takes experience and wisdom to upgrade to using Emacs. Besides, won't every currently young computer scientist be a middle aged computer scientist soon enough?
- 9y ago
- burkaman 9y agoThe most viewed question is even more relatable: https://stackoverflow.com/questions/927358/how-to-undo-last-commits-in-git https://stackoverflow.com/questions/927358/how-to-undo-last-... You can get the top viewed questions here: http://data.stackexchange.com/stackoverflow/query/53109/questions-with-most-views http://data.stackexchange.com/stackoverflow/query/53109/ques...
- logicallee 9y agohey Linus, undo last 1 git command (as though it had never been entered): git undo 1 thanks.
- emodendroket 9y agoI'll bet between the reflog and aliases you could do that.
- kccqzy 9y agoHow would you undo "git reflog expire"? How would you undo "git push origin -f"?
- majewsky 9y ago> git reflog expire Is there a valid reason to do this in the first place? > git push origin -f No standard way to undo that. Only do it if you must, and you absolutely do what's going to happen. Always do a "got remote update" immediately before the force-push and double-check that the remote branch points to what you expect. As a general rule, "--force" is short for "you better be prepared to deal with the consequences".
- hdhzy 9y ago> How would you undo "git push origin -f"? Remote reflog contains this info (if enabled). Of course not all commands would be reversible, especially not plumbing.
- 9y ago
- gogopuppygogo 9y agoI'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.
- vopi 9y agoIt literally everytime you boot the first screen tells you how to quit and get help. So..read the screen that comes up Everytime? If you try Ctrl c it tells you it's :q.
- jayflux 9y ago> developers are often dropped into Vim from a git command or another situation where they didn’t expect to be, and they run into it infrequently enough to forget how they solved it last time. So the first screen doesn't help in this situation The sort of developers who get stuck in Vim are not the ones who are using it intentionally
- signal11 9y agoHitting Ctrl+C still works, it tells you to type ":quit<Enter>".
- masklinn 9y agoWhy doesn't it just quit? That's as stupid as Python's >>> quit Use quit() or Ctrl-D (i.e. EOF) to exit The software knows perfectly well what I'm trying to do FFS.
- Macha 9y agoSo 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.
- dwyer 9y agoWhy would you ever exit vim?
- hartator 9y agoSometimes you'll need to update it for example.
- OJFord 9y agoIt's presumably possible to update and spawn a new instance from inside vim, but I won't say it's sensible.
- libria 9y ago"I've been using Vim for about 2 years now, mostly because I can't figure out how to exit it." [1] https://twitter.com/iamdevloper/status/435555976687923200?lang=en https://twitter.com/iamdevloper/status/435555976687923200?la...
- flavio81 9y agoTo enter Emacs or <insert your favorite editor here>, of course!!
- Theodores 9y agoWHAT IS ZZ? Because your keyboard is stuck on permanent caps lock and you cannot remember the alternative to ':wq' which you cannot enter due to the perma-caps input device that requires a reboot to become a keyboard again. If you use Synergy then this happens and a reboot can be easier if you are stuck. In theory you really could forget 'ZZ', I nearly forgot '=aB' for some reason recently, this '=aB' to indent is only really known in muscle memory and the actual '=aB' text is entered and gone quickly from the bottom of the screen, so never seen, merely memorised as muscle memory, not a written or vebalised thing.
- komali2 9y agoWell uh... like if I just rebase -i 'd, how do I continue going about GITing without exiting vim?
- ZenoArrow 9y agoI 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?
- gtsteve 9y agoImagine you don't know that. Now try to exit vim.
- ashark 9y agoAdd in the bonus confusion that you may not have even been trying to run vim, and in fact may not know what it is (hey, everyone's a beginner some time), but have landed there due to a default $EDITOR value. [EDIT] also, a typical mid-level computer user's tendency to slap "ESC" when panicked. Ha!
- fishywang 9y agoWhich OS/Linux distribution set default $EDITOR to vim? Personally I've never seen one, and I don't think vim is a sane default value for $EDITOR.
- recursive 9y agoDon't know about $EDITOR, but if you issue a git commit in Windows, and forget to specify -m, then you end up in vim.
- dom0 9y agoI dunno if it's actually vim or some variation on it, but it is the default on, for example, Arch Linux, although I believe most other distros dropped me into it as well (e.g. git commit / rebase -i). If there is such a thing as user hostile in the world of CLI tools, then dropping the user unannounced into vi with some open buffer most definitely counts as user hostile.
- 9y ago
- jszymborski 9y agoNot that it entirely matters, but those country/prog. language stats are useless since they don't normalise to site-wide traffic (or at least they don't seem indicate they do). Anecdotally, would get stuck in Vim having thought that the override command was :!q instead of :q!...
- hartator 9y agoMy favorite method: <crtl>+z kill -9 %1
- heeen2 9y agouser: that just typed ^Zkill -9 %1 into the text area :( (vim captures ^Z in input mode)
- ChuckMcM 9y agoI saw the bumper sticker ":w saves" and thought, to myself I wonder how many people "get" that. I suggested a long time ago that vi/vim bind ^C to exit. It currently is equivalent to 'esc' (it puts you into command mode if you aren't there and types the message "type :quit<Enter> to exit Vim". I'd much rather it popped up 'exit vim? y/n?' and the next key would determine if you exited or not.
- sirfz 9y agoThat looks more like emacs behavior though, vim rarely (never?) prompts the user for anything. You enter a command, you get a reaction (either an action like quits vim, or a message indicating something happened) -- which I personally prefer much more than getting annoying prompts.
- ChuckMcM 9y agoI don't disagree. And I like that vim doesn't prompt you a lot, but it is the one corner case where such prompting could be useful.
- spathi_fwiffo 9y agoit already tells you hot to quit when you hit control-c and if you happen to be in edit mode, hitting it twice gets you the message. if people don't notice the "Type :quit<Enter> to exit Vim" message, they also won't see the (Y/N) selection. so, absolutely nothing gained by making this change, except making things more annoying for people who do know how to use vim.
- LoSboccacc 9y agoSpeaking of which, Control-s is much dangerous to neofites
- icc97 9y agoYou get a prompt if you try to exit and you haven't written the buffer to file
- bluedino 9y agoHah. Back in the old days, when I didn't have a second computer to look up help online, I just powered my Linux PC off if I accidentally got trapped in vim. Later on, I'd just close my PuTTy session. Then I finally took a little bit of time to learn vim.
- dba7dba 9y agoHaha. I survived using vim JUST knowing Esc and :ws for years~. I was in a hurry to learn Linux and knowing vim was you know required. So I just learned the most basic in vim. I don't want to think about how much time of my life I wasted because I didn't know more about vim. Classic lesson about technical debt costing time/money over long term...
- deleted 9y ago[deleted]
- jerrylives 9y agoThat's well and all for vim but I've been trapped in ed for almost two decades!
- rhinoceraptor 9y ago?
- splawn 9y agotry "q"
- ajross 9y agoI can still remember sitting at a VT-220 in the college computer lab with my first Unix account (on a MIPS DECstation of all things), running emacs[1], getting stuck, and then sheepishly having to yank the power on the terminal to fix things. [1] Would have been emacs 18.something at the time. Not sure if that predates the built-in tutorial or if I just missed it. I remember running the tutorial not long thereafter on a proper workstation where I felt comfortable I could close the window.
- mangecoeur 9y agoIt doesn't help that the instructions within Vim to quit are clearly just wrong if following them to the letter doesn't actually work :P
- bandrami 9y ago(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 prudent enough not to overwhelm the novice with verbosity. (As a geezer, I also have to say I really am impressed with ed in some ways, and you should never be afraid to try it when you have a specific and known edit you want to do.)
- geofft 9y ago"When I use an editor, I don't want eight extra KILOBYTES of worthless help screens and cursor positioning code! I just want an EDitor!! Not a “viitor”. Not a “emacsitor”. Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!!" https://www.gnu.org/fun/jokes/ed-msg.txt https://www.gnu.org/fun/jokes/ed-msg.txt
- srcmap 9y agoUsing vi/vim lets one enter a secret dark corner of programmer society. Memorize vi keystrokes is knowing the secret handshakes. Able to Exit vim is finding the door to enlightenment. If vi comes with an easy "back" button like all browsers, no-one will learn it. One needs to be trapped inside for a while to feel the power of the dark side.
- throwaway7645 9y agoIs ":q!" really that crazy after 2 secs with Google?
- entelechy0 9y agoI always use ZZ
- Certhas 9y ago
- subcosmos 9y agokill -9 is your friend!
- ksenzee 9y agoWhen 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.
- falcolas 9y agoYes, please do chmod your SSH key, netrc, and other sensitive files as world readable! Sincerely, that other guy on your multi-user OS.
- ksenzee 9y agochmod 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.
- falcolas 9y agoMy point is that if you don't understand what chmod 0644 does, you probably shouldn't use it as general advice. chmod 0640 would be better general advice, but it's not a fix-all. Ditto `:wq`. If you're in vim, and you don't know how to exit, you probably don't want the random keypresses you made while trying to figure out how to exit to be written to the file. Another case where an alternate version might be better: [ESC]:q! nano <file>
- ksenzee 9y agoOf course it's not good general advice. It wasn't given as general advice. It was given as a tongue-in-cheek *nix cheat sheet.
- keithpeter 9y agoAnd as such would make a funny t-shirt. I remember seeing # apt-get a_life somewhere.
- draw_down 9y agoUgh, these types of editors drive me batty. Why can't it just be easy to quit? Why, why?! If I absolutely must use an editor in the terminal I use nano.
- chpmrc 9y agoNano? nah...no.
- amelius 9y agoAnd this is what it looks like: [1] :) [1] https://www.youtube.com/watch?v=zdcPZc21agk https://www.youtube.com/watch?v=zdcPZc21agk
- dschuetz 9y agoThere are two kinds of people - those who were able to exit vim, and those who stuck in it.
- heeen2 9y ago> 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 from the msdos line endings and comments in Korean that are in a weird multi byte encoding that I could not make vim display correctly. I think they use some sort of sftp synchronization tool like WinSCP when you edit a file remotely. I read that Windows is really deeply rooted in their IT culture, so much so that banking sites are required to use a special encryption scheme implemented in ActiveX. I can see why that would discourage people to use a different OS for their daily needs, let alone convince corporate IT to support dual boot.
- 0xfeba 9y agoIIRC, they had regulations about banking security that mandated some IE6 ActiveX plugin. They are just now, or just have, coming around to changing that.
- jondubois 9y agoThat'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.
- tdb7893 9y agoMaybe I've taken some crazy pills recently but I thought nano displayed the hotkey to exit on the screen.
- jondubois 9y agoActually it's exiting when you have unsaved changes which is confusing, the second prompt that comes up makes no sense to me. Also it shows a caret ^ character to represent the ctrl key which is confusing.
- golergka 9y agoOh, I hoped they finally invented something to help fight this addiction.
- ElijahLynn 9y agoUnfortunately that answer is wrong. The way they should have been taught is: ZQ - Quit without saving ZZ - Quit with saving
- xs 9y agoBut :q and :quit does in fact quit the program. It's also the command I've been using for 20 years... Why do you think it's "wrong"?
- ElijahLynn 9y agoThose are slower. ZQ is three keypresses. :q is four keypresses.
- GlickWick 9y agoThe people trying to get out of Vim probably don't care about having to press one extra key to escape it.
- ElijahLynn 9y agoRight, but if it is the first thing they learn most will stick with it for the rest of their life. We should teach them the most efficient way first. In my experience almost all of my colleagues over the past 5 years only new of :q, not ZQ.
- belovedeagle 9y agoPsh. Map ; to :, git gud.
- dageshi 9y agoI'm going to be perfectly honest, I got trapped like this in vi, decided that anything so complicated to exit out of wasn't for me and stuck with nano ever since.
- kowdermeister 9y agoPerfectly sane thing to do, you are not missing much.
- twic 9y agoI am also a nano user. I learned it because i use pine (now alpine) for email. I've stuck with it because it annoys my vi-using friends so much.
- bobzimuta 9y agoez 1. close terminal 2. remove all the temporary .swp files from the open buffers i just aborted
- xs 9y agoHow does one view the top viewed questions on stack overflow?
- dreamcompiler 9y agoLong, long ago in my programming infancy, I memorized a three-word ritual that has saved me countless hours over the years. It should be taught to freshmen CS students everywhere: Colon Queue Bang.
- Paul-ish 9y agoThe last graph shows, of people who get stuck in vim what language they use the most. This means this could just be a graph of the most used programming languages. eg if there is a uniform 10% probability that anyone will get stuck in vim. I would find it interesting to see a graph that show what percent of each language's users get stuck in vim.
- var_explained 9y agoThe latter is indeed what that graph is showing: what percentage of each language's users get stuck in Vim (or more precisely what % of their Vim visits are to that question). It's not being confused with the most used programming languages.
- Paul-ish 9y agoAh, excellent!
- blhack 9y agoI spent almost 10 years doing IT for a company whose backend was based entirely on as/400. If you've ever used a system like that, I'm sure you know where this is going... The console's that the front-desk or clerical users used every day had a steep learning curve. It was something that you would definitely not be able to walk up to and just intuit. However, once you figured it out, there is never going to be a faster UI that you are ever going to experience in your life until we figure out direct BCI stuff. It was funny watching the new people come on board and insist that we should change the UI to something with a mouse (probably web based). They had no idea that more immediately intuitive was actually a step backwards. My point is that just because something has a steep learning curve, that doesn't necessarily mean that it's a bad design.
- jakub_g 9y agoI work for a reservation systems company (a GDS) that is used by thousands of travel agencies. Of course, since the system was created 30 years ago, you were only able to create reservation with a text-based interface at the time, with short commands, inconsistent and complex flows to do some non-trivial things etc. So it's despised by newcomers because learning curve is steep. However, the company has been building new web-based solutions for a while, but all of them have so called "cryptic mode" where you can still directly input the commands, as it is order of magnitude faster, mandatory feature for experienced old-timer travel agents.
- Brotkrumen 9y agoAltea Amadeus. And all the three big GDS need to be thrown into a fire. "Oh you want to add a person to the PNR? Well tough luck! Not a use case we handle!"
- Brockenstein 9y agoYou should see how Sabre handles email address with it's bizarre, limited, possibly 7bit character set from 1959. In Sabre emails can be like 70 characters long. But periods count as two characters, as do underscores, and @ counts as four. I mean given the choice between period and cross of lorraine I know which I am choosing to include.
- darrmit 9y agoI remember getting stuck in emacs as a teenager on my only computer and having to just hold the power button down to get out because I had no way to search the Internet for the exit command. Haven't used emacs since. Good times.
- jordigh 9y agoSay what you want of Emacs, at least it has a clear exit strategy.
- jbmorgado 9y agoUnplugging the computer to shut down the Emacs OS?
- praptak 9y agoI've seen my share of :wq's actually submitted to source repos.
- icc97 9y agoI'm having a go at using Vim full time after years of dabbling. I attribute the weirdness of Vim to it being like learning a completely different actual language similar to learning French if you're an English speaker. With an editor you do almost everything through muscle memory, and so like speaking a language it's subconscious. Unless you've got a French English dictionary or Google Translate you've got very little hope. The problem is most GUI editor users assume that it's just an editor like they're used too. The only way to learn it, is like a language by speaking it all the time and changing the pathways in your brain. I want to get round to writing a translators guide for Sublime Text users on the basis that's probably the most similar GUI based editor to Vim. Then most people can translate their own editor to what ST does and from there figure out Vim.
- smnplk 9y ago:q!
- equalunique 9y ago& afterwards, run vimtutor
- _Codemonkeyism 9y agoNext: Helping a million developers join two lines in vim.
- bballer 9y agoShift + j
- rqebmm 9y agosighs wistfully I still remember the first day I was able to exit vim without looking it up. It's right up there with that one time I wrote a function that compiled and worked on the first try. Good times.
- eth0up 9y agoesc !killall -9 vim
- mmphosis 9y agoEDITOR=/Applications/TextEdit.app/Contents/MacOS/TextEdit cd /usr/bin rm vim vimtutor ln -s /Applications/TextEdit.app/Contents/MacOS/TextEdit vim
- motoboi 9y agoI remember the first time I was presented to Vim, my friend taught me to exit it by pressing CTRL-Z, lol. I think he kept it that way for years.
- joshbaptiste 9y agoE492: Not an editor command: Wq sigh Story of my life
- molecule 9y agonearly 24M, now > Github search for ":wq" returns more than 7,000,000 results https://github.com/search?q=%22%3Awq%22&ref=cmdform&type=Code* https://github.com/search?q=%22%3Awq%22&ref=cmdform&type=Cod... https://twitter.com/kennethn/status/470771879397949441?lang=en https://twitter.com/kennethn/status/470771879397949441?lang=...
- bigeast 9y agoAdd "set insertmode" into your friends' vimrc, then watch him burn :D
- wruza 9y agoThat's cruel. Also alias vim="rm -f" in .bash_profile
- mythrwy 9y agoWhy should we encourage exiting? Perhaps the mission is not complete and you should keep the file open until there are zero defects, everything is properly commented and you 100% understand everything and then some. At that point _maybe_ Vim shall let you exit! :)
- agumonkey 9y agoWould have been funny phrased with "quit" or "leave" for the double entendre.
- hawski 9y agoReading title I thought that it will be about helping people switch to a different text editor. One that is not an improved version of a text editor from 70s. I am a vim user, but I want to switch to something different. I mainly use it now, because of inertia. Don't bother with replying how editing model of vim is still relevant today. Or how one should think about vim as a language - a verb and a motion. I know all those arguments and I even agree with them to some extent. However I would argue that vim's interface is quite taxing for the mind - at least for my mind. Editing may be efficient, but I read more code then I edit.
- codingninja 9y agoTry Sublime Text, it has a VI mode that helps the move.
- vladimir-y 9y agoWant to edit text use Vim, want to edit code - use proper IDE.
- isthisnagee 9y agoIs code not ... text?
- twic 9y agoCode is usually represented as text, but it's not 'is' text. Or, since text is bytes, should we all be using hex editors for everything?
- wruza 9y agoProper IDE is fine, but then you switch to/embed another language and suffer. Btw, my colleagues often fail to perform simple tasks with proper IDEs, e.g. grepping entire project folder, not only files added to the project. Or moving through sources effectively, leaving interesting checkpoints in splits. Or respecting sw/ts/et settings per-file. Or formatting a table. IDEs are too high-level for these things, because they can refactor-omg-rename for ideally correct static language sources.
- drewg123 9y agoI met my wife because she was stuck in VI. I was a unix sysadmin in the early 90s, and she was a grad student. She came to me for help (like most of the 1st years did) because she couldn't get out of vi. However, to be fair, this was not her fault per-say. She actually knew how to use vi, but just couldn't find the ESC key. Does anybody remember the DEC keyboards where there was no traditional ESC key, but it was F11? (http://www.cosam.org/images/vt220/keyboard.jpg http://www.cosam.org/images/vt220/keyboard.jpg). Yeah, we used DECstations in the grad labs, and whenever a new grad student asked me a question in the 1st week, I'd answer "F11", and 90% of the time I was right.
- chpmrc 9y agoTHIS is the "How I met your mother" we want.
- deleted 9y ago[deleted]
- diminish 9y agoAnd I met mine, while she needed help trying to copy paste in emacs. IDE users, you're doomed to stay single!
- iheartmemcache 9y agoAnd to this very day, little Johnny, I thank the heavens that the sysop hadn't put CUA-mode into the /etc/skel/.emacs/init.el.
- NTripleOne 9y agoFine by me, that's more time I can spend not having to read manuals to use a text editor. :^)
- brianpan 9y agoIsn't emacs an IDE? :)
- deleted 9y ago
- paultopia 9y agoI wonder how many views there are for questions on exiting the numerous REPLs that are similarly unintuitive. (Node, Elixr, etc.)
- DannyB2 9y agoWhat about people who get stuck in Emacs and are unable to exit? They end up using Emacs lisp to create all other operations that they ever need on the computer. Emacs becomes their only environment.
- onwardly 9y agoFunny comment from the blog post: "I've been using vim for 10 years. I never could figure out how to quit."
- kobeya 9y ago> 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 one-tenth as much. That might indicate that when developers in these countries enter Vim, they usually meant to do so, and they know how to get out of it. More likely it means they are running Windows...
- mioelnir 9y agoI sometimes do a an IT jeopardy during interviews and :q! is "sysadmin 100".
- rz2k 9y agoWhen using a "ZZ" in command mode, I accidentally hit a ctrl-z every now and then. It took me a while to finally figure out that "fg" in the shell will bring the suspended vim session from the background to the foreground, so that I didn't have to kill the process.
- mattbgates 9y agoI remember my first dealings with Vim. It was awful. I kept having to hit the X button and reconnect, only to find that nothing saved. I've since switched over to nano and prefer it over any editor in Linux. Easy to use, easy to save. That's how it should be!
- milesvp 9y agoSadly, nano has (had?) the nasty habit of adding invisible characters on save (some combination of \r \n). I once almost got into a fist fight with a coworker over this, until he let me show him that his modifying the config was why some application kept crashing on restart.
- mattbgates 9y agoGood to know miles. I've used VIM, but it is more strict in editing and takes a while to get to know. nano is just a plain editor. I'll keep a lookout for it if something doesn't work.
- caycep 9y agoI'm highly amused this got 336 comments...
- void-star 9y agoAm I the only person who clicked on this link hoping it would provide guidance and help on how to switch to a different text editor after being "poisoned" by vi for so long? Whenever I write code (or anything else) in another editor I still always have to carefully check diffs to confirm I don't have any vi control mode characters interspersed with whatever I was writing. But I still can't quit using vi for everything else or my productivity goes into the toilet. vi why can't I quit you?
- nevatiaritika 9y ago> 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 one-tenth as much. That might indicate that when developers in these countries enter Vim, they usually meant to do so, and they know how to get out of it. I'd say no. I work in Japan and here everybody uses a Japanese equivalent of StackOverflow. This conclusion is so wrong.
- djrogers 9y agoHow is the conclusion wrong? If there is a cohort of developers in Japan that do use SO, then the statistics are still valid even if all developers in Japan don't use it.
- nevatiaritika 9y agoBecause the traffic is based on % of all vim visits. This means, if less Japanese visit, the share they have in the total % of all vim visits is also less.
- m-j-fox 9y agoBut it's so easy: [ctrl-z] kill -9 %1 You won't get out of notepad that easily.
- Animats 9y agoUX, the early days. I once typed "EDIT" to Interlisp when in the wrong mode, and Warren Teitelman's "Do What I mean" system printed "=EXIT" and exited the program without saving. DWIM was tuned rather closely to Warren's personal typing errors.
- rahoulb 9y agoI find files called :waq on my file system at least once per week
- kul_ 9y agoDid you also show her Sex.
- dang 9y agoCommenting like this will get your account banned here, so please don't do it again. We detached this comment from https://news.ycombinator.com/item?id=14405790 https://news.ycombinator.com/item?id=14405790 and marked it off-topic.
- deleted 9y ago[deleted]
- a_lieb 9y agoAssuming it takes an average of 1 minute for someone to look up the answer and quit Vim, the readers of this question alone spent a total of 2 years looking up how to quit Vim. Whether or not it was a good design choice, it goes to show how much of people's time and energy is at stake when you make software at enormous scale.
- keithnz 9y agothe hardest thing is, after their experience in trying to quit vim is then trying to tell them "No, it's actually quite an awesome editor....no it's not a piece of #$%!%.....no truly, it's good! .... oh you're back in your nice safe IDE, ok ok, we'll talk later" :)
- est 9y agoThe irony is that if someone asks the same question about a different editor, it would probably get closed by a bunch of mods and admins immediately.
- JdeBP 9y agoIt's interesting to observe that I am the only person to have spoken up about alarm bells going off when it got to the part about Ukraine being the place that visits the Stack Overflow WWW page the most. No-one in this discussion, or in other discussions that I have read, has yet said: > Hold on a minute! This is a WWW page in English, and yet you have the Ukraine, Turkey, Indonesia, and Pakistan as the top four countries by visitor? And the highest placed majority anglophone country is Canada, in sixteenth place? Hold your horses! Something is not right, here. I have seen this pattern myself, on one of my WWW servers. Ukraine and the Russian Federation are second and third on the list ... for HTTP. For HTTPS. however, it is a very different story. On the basis of my own experience, I question the accuracy of the statistics posted, and the accuracy of the conclusions based upon those statistics.
- lming 9y agoSpent a few hours to create a website for it: http://exitvi.info/ http://exitvi.info/ Interestingly, I found domains like howtoexitvim were registered immediately after this post showed up on HN.