5 ms·
:wq
- jrockway 12y agoFor you Emacs users, here's a search for Control-X Control-C. https://github.com/search?q=%18%03&type=Code&ref=searchresults https://github.com/search?q=%18%03&type=Code&ref=searchresul...
- informatimago 12y agowhich obviously does produce not source files from which the poor vi users tried to escape, but binary files where the codes should be there.
- informatimago 12y agowhich obviously does produce not source files from which the poor vi users tried to escape, but binary files where the codes should be there.
- deleted 12y ago[deleted]
- gggggggg 12y agoSorry, I do not get it? what is :wq ?
- daeken 12y agoIt writes and quits in vi(m).
- deleted 12y ago[deleted]
- avidas 12y agoWrite and quit on vi/vim, its quite hilarious to see them actually on code :)
- rch 12y agoHappens to me all the time if I'm in an IDE for some reason.
- girvo 12y agoYou use that command in Vim to save and exit the file. But as a modal editor, if you're in insert mode, you'll type it into the file as text instead of a command, thus the search here.
- deleted 12y ago[deleted]
- iamdev 12y agoThey're showing how often coders accidentally write ":wq" in their code, which is a common command in vim (save and quit).
- spyspy 12y agoIt's the method of saving and exiting a text file in Vim. ':' enters command input mode, 'w' writes to disk and 'q' quits the program. These people mistakenly typed and saved it in non-vim-edited text files.
- rzimmerman 12y agoIn vi it's save (write) then quit vi. But if you're in the wrong mode it just thinks you're typing in the file.
- platz 12y agoPages 34-100 of the results are all from the android linux kernel, so actually just consider relevant results to be about 1/4 the reported size.
- JimmaDaRustla 12y agoLooks like most results up to page 34, the ":wq" was left in intentionally or the file is just bogus so the author didn't care.
- nsxwolf 12y agoI know what :wq is, but what is... this?
- noobermin 12y agoSupposedly a listing of accidental commits of the text ":wq" and variants where the coder really meant to save the file in vim and quit.
- eranation 12y agowhy not :x ?
- GhostHardware 12y agoOr ZZ.
- ma2rten 12y agoLately, I keep accidentally creating files that are named ":w" and I don't even know how I do it.
- collinvandyck76 12y agoI find :wq in my code commits more often than i like. It's most always when using IDEAVim, and I imagine it would be the same case for any other partial vim-emulator. For some reason, I'm just more prone to not hitting the escape sequence correctly in those editors.
- deleted 12y ago[deleted]
- couchand 12y agoThis is one of the many reasons that I think it's important to develop a healthy distrust of insert mode. Staying in normal mode as much as possible also encourages good use of navigation commands.
- dhanush 12y agoThis is the exact reason why I switched to Emacs about a year ago. Sure the transition was difficult. But never regretted it!
- fidz 12y agoI wonder why people can accidentally type ":wq" in insert mode and save it. What are example use cases that make people accidentally save ":wq" document? I often use vim and so far almost never accidentaly save ":wq" file.
- wink 12y agoI had that problem lately on a new box where "set -sg escape-time 0"[0] was not set in tmux. It feels so different and annoying I kept mashing the buttons. [0]: http://superuser.com/questions/252214/slight-delay-when-switching-modes-in-vim-using-tmux-or-screen http://superuser.com/questions/252214/slight-delay-when-swit...
- JimmaDaRustla 12y agoFirst thing: The ":wq" search brings back "wq" results as well, so the results contain any instance of wq (crypto libraries, android kernel, variable names, wq.io framework, etc.) rather than just accidental vim writes. Second thing: Most all of the ":wq" are in redundant bogus files, many authors knowingly leaving the accidental insertion in. "asdfasdfasdf:wq" Edit: 6 million of the 7 millions results are in C language - mostly all variable names and library names. In actuality, it seems like only the first 34 pages have any relevant results. Even if the author forgot to escape insertion mode before issuing the command, they would have realized that vim did not close and that a new line was created. Anyone jumping on the "this is why vim sux" bandwagon here is biased or incompetent. If this was really an issue for individuals, they could just configure a key combination to to save no matter what mode your in. HN seems to be becoming pedantic and ignorant in many ways.
- richardlblair 12y agoWhat really rustles my jimmies is these posts in general. Who gives a shit what editor people use? We are all programmers typing text into a damn box. Who cares what kind of box? The outcome is the damn same. And for every person who accidentally committed ":wq" I'll show you some sublime user writing python using tabs, not spaces, for spacing. Either way, these editor posts are a waste of everyone's time. Use whatever editor you want to use... the community shouldn't bash you for it.