TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Helping a Million Developers Exit Vim

775 pointsby var_explainedalmost 8 years ago

66 comments

drewg123almost 8 years ago
I 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&#x27;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&#x27;t find the ESC key.<p>Does anybody remember the DEC keyboards where there <i>was</i> no traditional ESC key, but it was F11? (<a href="http:&#x2F;&#x2F;www.cosam.org&#x2F;images&#x2F;vt220&#x2F;keyboard.jpg" rel="nofollow">http:&#x2F;&#x2F;www.cosam.org&#x2F;images&#x2F;vt220&#x2F;keyboard.jpg</a>). Yeah, we used DECstations in the grad labs, and whenever a new grad student asked me a question in the 1st week, I&#x27;d answer &quot;F11&quot;, and 90% of the time I was right.
评论 #14405910 未加载
评论 #14406061 未加载
评论 #14407143 未加载
评论 #14406787 未加载
评论 #14406055 未加载
评论 #14407763 未加载
评论 #14406378 未加载
评论 #14406559 未加载
评论 #14407841 未加载
评论 #14407216 未加载
评论 #14407235 未加载
评论 #14406331 未加载
bandramialmost 8 years ago
(Attribution is questionable, but as a geezer I feel the need to make sure the younger generations at least are familiar with this:)<p>ed is the standard text editor<p>Let&#x27;s look at a typical novice&#x27;s session with the mighty ed:<p><pre><code> golem&gt; 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. </code></pre> (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.)
评论 #14403749 未加载
评论 #14403536 未加载
评论 #14404215 未加载
评论 #14403589 未加载
评论 #14404675 未加载
评论 #14403579 未加载
评论 #14405812 未加载
评论 #14405639 未加载
评论 #14403537 未加载
blhackalmost 8 years ago
I spent almost 10 years doing IT for a company whose backend was based entirely on as&#x2F;400. If you&#x27;ve ever used a system like that, I&#x27;m sure you know where this is going...<p>The console&#x27;s that the front-desk or clerical users used every day had a <i>steep</i> learning curve. It was something that you would definitely not be able to walk up to and just intuit.<p><i>However</i>, once you figured it out, there is <i>never</i> going to be a faster UI that you are ever going to experience in your life until we figure out direct BCI stuff.<p>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.<p>My point is that just because something has a steep learning curve, that doesn&#x27;t <i>necessarily</i> mean that it&#x27;s a bad design.
评论 #14404013 未加载
评论 #14404306 未加载
评论 #14405807 未加载
评论 #14405779 未加载
评论 #14404712 未加载
评论 #14421470 未加载
评论 #14404912 未加载
评论 #14404369 未加载
burkamanalmost 8 years ago
The most viewed question is even more relatable: <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;927358&#x2F;how-to-undo-last-commits-in-git" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;927358&#x2F;how-to-undo-last-...</a><p>You can get the top viewed questions here: <a href="http:&#x2F;&#x2F;data.stackexchange.com&#x2F;stackoverflow&#x2F;query&#x2F;53109&#x2F;questions-with-most-views" rel="nofollow">http:&#x2F;&#x2F;data.stackexchange.com&#x2F;stackoverflow&#x2F;query&#x2F;53109&#x2F;ques...</a>
评论 #14403516 未加载
评论 #14404257 未加载
评论 #14408010 未加载
评论 #14403444 未加载
ChuckMcMalmost 8 years ago
I saw the bumper sticker &quot;:w saves&quot; and thought, to myself I wonder how many people &quot;get&quot; that.<p>I suggested a long time ago that vi&#x2F;vim bind ^C to exit. It currently is equivalent to &#x27;esc&#x27; (it puts you into command mode if you aren&#x27;t there and types the message &quot;type :quit&lt;Enter&gt; to exit Vim&quot;. I&#x27;d much rather it popped up &#x27;exit vim? y&#x2F;n?&#x27; and the next key would determine if you exited or not.
评论 #14406018 未加载
评论 #14403787 未加载
评论 #14405155 未加载
bluedinoalmost 8 years ago
Hah. Back in the old days, when I didn&#x27;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&#x27;d just close my PuTTy session.<p>Then I finally took a little bit of time to learn vim.
评论 #14406864 未加载
ksenzeealmost 8 years ago
When 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:<p><pre><code> chmod 0644 [Esc] :wq </code></pre> Best advice I&#x27;ve ever gotten.
评论 #14403848 未加载
hawskialmost 8 years ago
Reading 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.<p>I am a vim user, but I want to switch to something different. I mainly use it now, because of inertia. Don&#x27;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&#x27;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.
评论 #14406547 未加载
doktrinalmost 8 years ago
Obviously my personal bias, but it&#x27;s emacs I can never remember how to exit from.
评论 #14403247 未加载
评论 #14405099 未加载
评论 #14403627 未加载
评论 #14403395 未加载
评论 #14403364 未加载
评论 #14403257 未加载
评论 #14425330 未加载
评论 #14403867 未加载
评论 #14403309 未加载
评论 #14404070 未加载
评论 #14403437 未加载
dwyeralmost 8 years ago
Why would you ever exit vim?
评论 #14403485 未加载
评论 #14403456 未加载
评论 #14403690 未加载
评论 #14403923 未加载
评论 #14406230 未加载
icc97almost 8 years ago
I&#x27;m having a go at using Vim full time after years of dabbling.<p>I attribute the weirdness of Vim to it being like learning a completely different actual language similar to learning French if you&#x27;re an English speaker.<p>With an editor you do almost everything through muscle memory, and so like speaking a language it&#x27;s subconscious.<p>Unless you&#x27;ve got a French English dictionary or Google Translate you&#x27;ve got very little hope.<p>The problem is most GUI editor users assume that it&#x27;s just an editor like they&#x27;re used too.<p>The only way to learn it, is like a language by speaking it all the time and changing the pathways in your brain.<p>I want to get round to writing a translators guide for Sublime Text users on the basis that&#x27;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.
nevatiaritikaalmost 8 years ago
&gt; 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.<p>I&#x27;d say no. I work in Japan and here everybody uses a Japanese equivalent of StackOverflow. This conclusion is so wrong.
评论 #14407372 未加载
dageshialmost 8 years ago
I&#x27;m going to be perfectly honest, I got trapped like this in vi, decided that anything so complicated to exit out of wasn&#x27;t for me and stuck with nano ever since.
评论 #14406033 未加载
评论 #14405882 未加载
heeen2almost 8 years ago
&gt; 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.<p>From my experience, people at least from Korea are very likely to develop on windows, even when targeting linux or even embedded linux.<p>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.<p>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.
评论 #14403731 未加载
hartatoralmost 8 years ago
My favorite method:<p><pre><code> &lt;crtl&gt;+z kill -9 %1</code></pre>
评论 #14403520 未加载
kobeyaalmost 8 years ago
&gt; 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.<p>More likely it means they are running Windows...
jonduboisalmost 8 years ago
That&#x27;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&#x27;s difficult to find info online because it&#x27;s hard to explain nano&#x27;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.
评论 #14403717 未加载
joshbaptistealmost 8 years ago
<p><pre><code> E492: Not an editor command: Wq</code></pre> <i>sigh</i> Story of my life
评论 #14408440 未加载
评论 #14405747 未加载
mmphosisalmost 8 years ago
<p><pre><code> EDITOR=&#x2F;Applications&#x2F;TextEdit.app&#x2F;Contents&#x2F;MacOS&#x2F;TextEdit cd &#x2F;usr&#x2F;bin rm vim vimtutor ln -s &#x2F;Applications&#x2F;TextEdit.app&#x2F;Contents&#x2F;MacOS&#x2F;TextEdit vim</code></pre>
DannyB2almost 8 years ago
What about people who get stuck in Emacs and are unable to exit?<p>They end up using Emacs lisp to create all other operations that they ever need on the computer. Emacs becomes their only environment.
void-staralmost 8 years ago
Am 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 &quot;poisoned&quot; by vi for so long?<p>Whenever I write code (or anything else) in another editor I still always have to carefully check diffs to confirm I don&#x27;t have any vi control mode characters interspersed with whatever I was writing.<p>But I still can&#x27;t quit using vi for everything else or my productivity goes into the toilet.<p>vi why can&#x27;t I quit you?
Paul-ishalmost 8 years ago
The 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 <i>anyone</i> will get stuck in vim. I would find it interesting to see a graph that show what percent of each language&#x27;s users get stuck in vim.
评论 #14404030 未加载
a_liebalmost 8 years ago
Assuming 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 <i>2 years</i> looking up how to quit Vim. Whether or not it was a good design choice, it goes to show how much of people&#x27;s time and energy is at stake when you make software at enormous scale.
JdeBPalmost 8 years ago
It&#x27;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:<p>&gt; <i>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><p>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.<p>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.
Animatsalmost 8 years ago
UX, the early days.<p>I once typed &quot;EDIT&quot; to Interlisp when in the wrong mode, and Warren Teitelman&#x27;s &quot;Do What I mean&quot; system printed &quot;=EXIT&quot; and exited the program without saving. DWIM was tuned rather closely to Warren&#x27;s personal typing errors.
ElijahLynnalmost 8 years ago
Unfortunately that answer is wrong. The way they should have been taught is:<p>ZQ - Quit without saving<p>ZZ - Quit with saving
评论 #14403976 未加载
darrmitalmost 8 years ago
I 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&#x27;t used emacs since. Good times.
ajrossalmost 8 years ago
I 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.<p>[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.
rz2kalmost 8 years ago
When using a &quot;ZZ&quot; in command mode, I accidentally hit a ctrl-z every now and then. It took me a while to finally figure out that &quot;fg&quot; in the shell will bring the suspended vim session from the background to the foreground, so that I didn&#x27;t have to kill the process.
jszymborskialmost 8 years ago
Not that it entirely matters, but those country&#x2F;prog. language stats are useless since they don&#x27;t normalise to site-wide traffic (or at least they don&#x27;t seem indicate they do).<p>Anecdotally, would get stuck in Vim having thought that the override command was :!q instead of :q!...
mattbgatesalmost 8 years ago
I 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&#x27;ve since switched over to nano and prefer it over any editor in Linux. Easy to use, easy to save. That&#x27;s how it should be!
评论 #14406539 未加载
dschuetzalmost 8 years ago
There are two kinds of people - those who were able to exit vim, and those who stuck in it.
lmingalmost 8 years ago
Spent a few hours to create a website for it: <a href="http:&#x2F;&#x2F;exitvi.info&#x2F;" rel="nofollow">http:&#x2F;&#x2F;exitvi.info&#x2F;</a><p>Interestingly, I found domains like howtoexitvim were registered immediately after this post showed up on HN.
mythrwyalmost 8 years ago
Why should we encourage exiting?<p>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.<p>At that point _maybe_ Vim shall let you exit!<p>:)
rqebmmalmost 8 years ago
<i>sighs wistfully</i> I still remember the first day I was able to exit vim without looking it up. It&#x27;s right up there with that one time I wrote a function that compiled and worked on the first try.<p>Good times.
dreamcompileralmost 8 years ago
Long, 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.
praptakalmost 8 years ago
I&#x27;ve seen my share of :wq&#x27;s actually submitted to source repos.
rahoulbalmost 8 years ago
I find files called :waq on my file system at least once per week
moleculealmost 8 years ago
nearly 24M, now<p><i>&gt; Github search for &quot;:wq&quot; returns more than 7,000,000 results <a href="https:&#x2F;&#x2F;github.com&#x2F;search?q=%22%3Awq%22&amp;ref=cmdform&amp;type=Code*" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;search?q=%22%3Awq%22&amp;ref=cmdform&amp;type=Cod...</a><p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;kennethn&#x2F;status&#x2F;470771879397949441?lang=en" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;kennethn&#x2F;status&#x2F;470771879397949441?lang=...</a>
ameliusalmost 8 years ago
And this is what it looks like: [1] :)<p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=zdcPZc21agk" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=zdcPZc21agk</a>
ZenoArrowalmost 8 years ago
I barely use any Vim, but I&#x27;m more confused about there being some hidden complexity in exiting Vim that I&#x27;m not aware of.<p>Isn&#x27;t it just...<p>[Esc] :wq<p>...or...<p>[Esc] :q!<p>...depending if you want to save the current document or not?
评论 #14403330 未加载
评论 #14403361 未加载
评论 #14403356 未加载
评论 #14403353 未加载
评论 #14403340 未加载
评论 #14403346 未加载
评论 #14403349 未加载
评论 #14403491 未加载
评论 #14403425 未加载
评论 #14403685 未加载
estalmost 8 years ago
The 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.
mangecoeuralmost 8 years ago
It doesn&#x27;t help that the instructions within Vim to quit are clearly just wrong if following them to the letter doesn&#x27;t actually work :P
motoboialmost 8 years ago
I 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.
paultopiaalmost 8 years ago
I wonder how many views there are for questions on exiting the numerous REPLs that are similarly unintuitive. (Node, Elixr, etc.)
keithnzalmost 8 years ago
the hardest thing is, after their experience in trying to quit vim is then trying to tell them &quot;No, it&#x27;s actually quite an awesome editor....no it&#x27;s not a piece of #$%!%.....no truly, it&#x27;s good! .... oh you&#x27;re back in your nice safe IDE, ok ok, we&#x27;ll talk later&quot; :)
onwardlyalmost 8 years ago
Funny comment from the blog post:<p>&quot;I&#x27;ve been using vim for 10 years. I never could figure out how to quit.&quot;
agumonkeyalmost 8 years ago
Would have been funny phrased with &quot;quit&quot; or &quot;leave&quot; for the double entendre.
mioelniralmost 8 years ago
I sometimes do a an IT jeopardy during interviews and :q! is &quot;sysadmin 100&quot;.
bigeastalmost 8 years ago
Add &quot;set insertmode&quot; into your friends&#x27; vimrc, then watch him burn :D
评论 #14407574 未加载
golergkaalmost 8 years ago
Oh, I hoped they finally invented something to help fight this addiction.
smnplkalmost 8 years ago
:q!
评论 #14406064 未加载
m-j-foxalmost 8 years ago
But it&#x27;s so easy: [ctrl-z] kill -9 %1<p>You won&#x27;t get out of notepad that easily.
jordighalmost 8 years ago
Say what you want of Emacs, at least it has a clear exit strategy.
评论 #14404923 未加载
vladimir-yalmost 8 years ago
Want to edit text use Vim, want to edit code - use proper IDE.
评论 #14407507 未加载
评论 #14405842 未加载
xsalmost 8 years ago
How does one view the top viewed questions on stack overflow?
_Codemonkeyismalmost 8 years ago
Next: Helping a million developers join two lines in vim.
评论 #14406472 未加载
caycepalmost 8 years ago
I&#x27;m highly amused this got 336 comments...
bobzimutaalmost 8 years ago
ez<p>1. close terminal<p>2. remove all the temporary .swp files from the open buffers i just aborted
eth0upalmost 8 years ago
esc<p>!killall -9 vim
subcosmosalmost 8 years ago
kill -9 is your friend!
gogopuppygogoalmost 8 years ago
I&#x27;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.
评论 #14403852 未加载
评论 #14403313 未加载
评论 #14403850 未加载
评论 #14403449 未加载
评论 #14403358 未加载
评论 #14404042 未加载
评论 #14403861 未加载
评论 #14403760 未加载
评论 #14403326 未加载
评论 #14403471 未加载
评论 #14404085 未加载
评论 #14403992 未加载
评论 #14403825 未加载
评论 #14403561 未加载
评论 #14403903 未加载
评论 #14403541 未加载
评论 #14403918 未加载
评论 #14403956 未加载
评论 #14404910 未加载
评论 #14404892 未加载
评论 #14403782 未加载
评论 #14403418 未加载
评论 #14403442 未加载
评论 #14403553 未加载
jerrylivesalmost 8 years ago
That&#x27;s well and all for vim but I&#x27;ve been trapped in ed for almost two decades!
评论 #14403512 未加载
评论 #14403730 未加载
kul_almost 8 years ago
Did you also show her Sex.
评论 #14415652 未加载
ben_jonesalmost 8 years ago
Isn&#x27;t that exclusively used by middle aged computer scientists?
评论 #14405474 未加载
评论 #14403327 未加载
评论 #14403374 未加载
评论 #14403527 未加载
评论 #14403474 未加载
draw_downalmost 8 years ago
Ugh, these types of editors drive me batty. Why can&#x27;t it just be easy to quit? Why, why?! If I absolutely must use an editor in the terminal I use nano.
评论 #14405929 未加载