Everyone Who Tried to Convince Me to use Vim was Wrong (2010)
yehudakatz.com
yehudakatz.com
I can be certain of that, as I still use actual arrow keys to this day: I started using vim well over a decade ago, maybe almost two, and I simply never got around to using hjkl. There is thereby no chance in hell that I would have told him to turn off the arrow keys (although we both know someone who probably did, who worked with him much more closely, but he has a personality type that requires him to "whole hog" everything he tries ;P).
It also has taken me forever to get around to learning even things like "cw", which I only just integrated into my behaviors a year ago. It's even a running gag on the IRC channel I spend most of my time on (and where Yehuda used to hang out) that vim is something that everyone knows some barely overlapping subset of the keyboard behaviors for ;P.
It is true that I would have been telling him to use console versions of vim, but my definition of "console" has always had "mouse support" as a key requirement: until just about two years ago I always had "set mouse=a" turned on by default, which gives you the ability to click around in both command and input modes, the ability to click and drag to automatically enter visual mode, and (in particular) fully operational mouse wheel scrolling support.
I thereby can only imagine that Yehuda simply got such strong pressure from some subset of the people who were talking to him about vim that it got him so generally angry about the whole situation that is "use vim" that by 2010 he got to the point where it just seemed like "everyone" was telling him to "whole hog" vim; I thereby can happily appreciate why this article got written the way that did.
However, I think people repasting it around now may end up with the wrong impression of "people who use vim" as a whole by going back and looking at Yehuda during this one moment from 2010 and then using this article as a guide to something important today about that community. (Which explains why I didn't ever comment on the original article, but if people are going to bring it back, I feel the need to do so ;P.)
I could think fast, but although I was the "fastest kid in the block" when it comes to writing code, I always wanted more.
In a pedantic process, this is what I did go through, over the time span of around 7 years:
* Learning to touch type properly.
* Testing out many keyboards (I settled on a clone of an apple keyboard that has no numpad, short keystroke).
* Testing out Dvorak, Colemak, for more than a year, only to return to QWERTY because it is omnipresent.
* Optimizing IDE and editor shortcuts, keybindings, and live templates
* Trying out every editor under the sun, including Emacs, taking care to leave Vim out (because I held it as "not worth it"). I remember trying out a very very alpha SublimeText that didn't have undo -- funny how things go.
* Optimizing the colorscheme and button and canvas layouts of IDEs. I went for blank - hide everything and leave only the canvas visible - in Intellij, Visual Studio, and Eclipse.
Eventually, I read Yehuda's article 2 years ago. I took the same approach, and it's been amazing. I have never felt my brain connected to my editor this well.
I still "use Vim my own way". I save with CTRL-S, copy-paste with CTRL-C/V for example. I'm fully aware of the proper way to do it, and I do that when I'm ssh'd in a server. It is embarrassing but it works. I'm slowly shaving away these embarrassing usage scenarios and becoming a 'pure' Vim user.
Today, I write entire products and libraries at amazing speed (this includes creating files and directory layouts with NERDTree, jumping to files with CTRL-P, etc - no mouse whatsoever, which is very hard to do in a traditional IDE).
I would go further and say that in certain situations (dynamic languages) Vim does become the Holy Grail for me; and I owe that to Yehuda.
Thanks, wycatz!
Me, I type code. I copy & paste code. I do global searches on the source tree, and every now and then on a single file. The editor has file-type sensitive syntax highlighting, which is nice enough but not all that important. And that's about it: that's all you need to work as a professional software developer.
So when I hear people getting all worked up about these antique editors, it sounds a lot like listening to a bike snob go on about fixies.
Going to the article you cited, the ultimate magic appears to be the use of macros. Defining composable (mini-)languages that are appropriate for a given domain is indeed very powerful and produces significant reductions in the amount of code typed to solve the domain problems. By the way, ASTs for domain-specific languages can be implemented in most common languages via very mundane enums, unions and switches. But I digress.
"Text editing" problems are much simpler than "build an e-commerce web-site" problems. While both Lisp and Vi happen use macros, this feels more of a coincidence. The actual need for macros is much higher in the ViaWeb scenario.
Allow me to reiterate the OC comment: What is it that a ninja text editor actually does with his super-human powers?
It was awful, I tried it twice before I actually succeeded in switching to it. But eventually, I got used to all the arcane keyboard shortcuts, began to appreciate the power of a program that allowed me to interact with everything (well, except for ncurses based terminal applications) and I became hooked.
I firmly credit Emacs for making it easier for me to switch to new languages, I've learned more about GNU tools from info than from anywhere else, and I absolutely adore keyboard macros (as they always felt like something a program should be able to do). So, for me at least, the benefit of learning this arcane program was that it exposed me to a method for learning new things while still having some level of skill in the environment.
That being said, I really need to learn some vim, for the logging into a remote server with no permissions scenario.
"There is also a bird there [in the bald and barren north], named P'eng, with a back like Mount T'ai and wings like clouds filling the sky. He beats the whirlwind, leaps into the air, and rises up ninety thousand li, cutting through the clouds and mist, shouldering the blue sky, and then he turns his eyes south and prepares to journey to the southern darkness.
"The little quail laughs at him, saying, 'Where does he think he's going? I give a great leap and fly up, but I never get more than ten or twelve yards before I come down fluttering among the weeds and brambles. And that's the best kind of flying anyway! Where does he think he's going?' Such is the difference between big and little."
http://terebess.hu/english/chuangtzu.html#1
I actually agree with marssaxman (and I'm not certain that Chuang Tzu is equating big with good and little with bad), but clearly whether the choice of editor is significant is a question of perspective, and everybody is going to have a different one. I used to care quite a bit about editors. Now I see a lot of our industry tool fetishism as rather unproductive. But I have seen people use the hell out of Vim and it's really quite impressive. Just not a skill I personally feel a strong need to develop.
Vim users like vim for some legitimate reasons (e.g. ubiquity) and some illegitimate reasons (e.g. speed). But to my eyes, it's typically the users of heavy IDEs who seem to be insecure in their choice, to the point that they get offended by the fact that vim works for others. Take marssaxman as a case in point.
As a clojure hobbyist, Light Table might one day be amazing. But it's not yet.
Additionally, your tools shouldn't define you as a programmer, and yet I often see people getting shamed for using an IDE instead of vim/emacs/whatever.
I've used IDEs, a lot. And not decades ago, I try new IDEs out all the time. When I write Jenkins plugins it's in NetBeans. I have tried out SublimeText 2 quite a bit. I used to write games so I spent all my time in Visual Studio with Visual Assist X.
Given all that, when I want to write some C++ I fire up vim. Not because I'm unaware of all the IDEs out there and all they can do. But because I'm very efficient using vim, find, grep, sed/awk, etc.
It's not offensive to wonder why such old tools are still so popular, but it's offensive to assume that they're popular because their users are ignorant. Maybe you just haven't gotten it yet (and won't). Or maybe we just have different use-cases. The vim commands obviously aren't obscure to me since I know them.
I agree that your tools shouldn't define you as a programmer. Clearly I wouldn't shame anyone for using an IDE, since I do all the time when it makes sense to. The problem is that many IDE users just can't accept that I use vim because I work well in it, not because I think it's trendy. I can work well in any environment you throw me into, because 90% chance it has vi, and otherwise it has Notepad. Most VisualStudio users can't say the same. Fine, they don't think that's an important skill, I can accept that, just don't tell me it's not important to me.
As in: "I use Vim, I'm so much better than those blub Sublime Text programmers"
Even if Vim keybindings don't make me any more productive, they sure make my life more pleasant.
This is not about time optimisation[0]. If your current editor does not feel like a hurdle to you, then certainly don't change it (you have the right to be curious though :-)
That said, after you get comfortable using insert mode with just the most basic command mode stuff, I would highly recommend incrementally expanding your use of command mode. Learn about yank registers, movement units (words, sentences, brackets, quoted text), how to repeat commands, how to record and play macro's, split buffers and how to move around buffers and windows, etc. You could start by adding one command or feature each week and go from there.
If you never invest time expanding your vim knowledge and habits, there really isn't much of a reason to use vim at all. The whole point of vim is that it has so many crazy productivity-enhancing features. If you don't want to spend time to learn any of them then just don't bother, but realize that no 'easy to use', fully GUI-driven editor could ever come close to the editing efficiency you can theoretically get using a command-mode editor such as vim. There really is truth in what people say, once you master the most useful aspects of vim, you can never go back.
That's why I learned vi back in 2004, and while I still get tripped up when backspace doesn't work in insert mode because of some terminal setting, using hjkl has become second nature. There's a lot to be said for absolutely having to learn something.
Once I learned enough to be proficient doing simple editing, I switched to using gvim on my Windows machines, and then learned more as I found myself wondering if there was a better way to do something. Now I do virtually all of my coding in vim. The only downside of this I've found is that I'll occasionally C-w when typing in a web form and close my tab instead of deleting the last word.
I never got interested enough in emacs to learn it, but if I find myself in a situation where it's what I need to accomplish something I'll learn it. Need is a powerful motivator.
EDIT: I should also note that learning vi[m] on a computer with a Sun layout keyboard makes the idea of switching into command mode a lot more palatable. Esc is right there next to the 1, rather than somewhere in the next state.
That said, I'm more of an emacs guy.
And three years ago: https://news.ycombinator.com/item?id=1559074
_________________ isn't for everyone. That's ok.
Arguing over the preference of tools/languages/frameworks creates distractions of "are you missing out?" instead of the real world needs of "customers don't care what you code in, or what you code with".
Most tools, languages, and frameworks all have their pros and cons and when all is said and done, most of the popular and not so well known ones are perfectly suitable.
Tools are about as relevant now as buying a hammer vs a high end hammer. You still have to know what to nail, and why according to a more clever architecture, not using clever nails no one knows how to use after you're gone.
Developers spend so much time optimizing their own experience developing that I can't help but wonder if the software they end up writing ends up missing out -- not in technical or architectural flexibility, but solving the problem as best as it could be for the end user -- from their world -- in their terms of getting more done with less effort.
I've tried and not picked up Vim as well. I did notice I had better luck at it when I was using vim with a small personal project that allowed me to learn vim as I went, instead of needing to be at 100% speed and efficiency immediately.
The tutorial there will get you going really quickly, especially in combination with reading Yehuda's article. It's also worth checking out this distribution https://github.com/carlhuda/janus
It's easy to install and comes with a bunch of great plugins. One of the huge benefits of vim is the plugin community.
My Sublime-2 with Brief key emulations is like that now. If it takes 3+ keys presses to switch between "modes" or accomplish simple and frequent operation - that tool is for masochists, not for creative productive people.
1. Tried vim in college, only ever used insert mode + <esc>:wq 2. Discovered Textmate or similar and loved it; only used vim for the occasional remote editing 3. Tried to get into vim on the advice of friends, but always ended up reverting to using it like notepad in insert mode because it was easier than looking up the command they needed. 4. Went whole-hog into vim one day, turning off arrow keys, and immersing themselves in it. After a few days, they were as productive as they were in textedit, and after a few weeks they had drunk the kook-aid and were more productive than previous editors.
So, while I don't condone badgering a guy to learn this way so much that he writes an angry post, I would argue that going all-in on Vim is the best way to learn it for most people I've talked to (myself included).
Vi splits insert and edit modes by time: you hit keys to toggle between them, letting you move the mouse less. Acme does it by space: blue bits of the screen hold commands, beige ones hold text, letting you remember less. To repeat a command in vi, you have to remember what you did. In acme, you look for it and click it again.
Acme lacks an exact equivalent to vi's w, t and other motion commands. However, double-click does "select what I mean", commands operate on the selection by default, and mouse chords do copy and paste. I find that's enough.
Some people will always prefer vi, but acme could be a gateway drug for many others. You can use it like Notepad, but there's a lot of magic hidden a mouse click away.
I'm an admin not a coder, so I usually just edit conf files and firewall rules. I do spend all day at the cli and do write scripts as needed but I haven't found the need to learn vim.
Use what works best for you.
it's an online interactive "try vim" kind of tutorial
I wonder if there are more things like this
`end` is easier than `esc A` `ctrl+home` easier then `esc g g i` ...
Yehuda's advice isn't so bad. If the purpose is to be as efficient as possible, which is what I think most of us strive for, then why not use the extra keys? It took several weeks, actually months to become productive in Vim. Learning was a cycle of try Vim, get frustrated, go back to modeless editor until there is some down time, repeat. Vim bootcamp wasn't any fun.
This is definitely what I recommend to people curious about Vim, and also what I recommend to people curious about functional programming. Saying "Here, start with Category Theory" is a great way to get a purely imperative programmer to stay that way.
[1] Which you may know as 'hack' or 'nethack'
I've never had a time where I felt I didn't have enough time to write all the code, but I've had plenty of times where I've felt I didn't have enough time to fix all of it.
You can get by with a small subset of commands that are close to what you use in graphical editors. Anything you learn on top of that is gravy.
Plausible reason: hands do not leave the home row, so you can type faster.
That said, I switch between letters and arrows depending on what I'm doing. Sometimes the arrows just seem more natural.
Let's say you delivered packages using a horse and buggy, and people started talking about this new fangled "automobile" thing. Sure, you could try to dive into it and use an automobile for your next delivery. And when you crash the thing and your delivery isn't made, you get pissed off and say "I'm never using an automobile again!"
Or.. you could keep using your horse and buggy at work, and start learning the automobile in your free time. Then, once you've mastered the automobile, start using it at work.
But I'd disagree with the advice of learning vim a little bit at a time. It may be necessary to do that if you're trying to learn vim at work, but most people will acquire bad habits that way and learn to use vim in a watered down way. You've now tied some reins to the steering wheel and are sitting on the automobile's roof, trying to reach in the window and whip the gas pedal.
For those who don't use vim, switch right now (unless you're at work.) If you want to be productive, you'll have to learn to love the home row.
As an aside, it might be worth it to learn a couple of emacs movement commands as well if you're using OS X, as you'll be able to navigate textboxes without leaving the home row as well!
I only got invested in Vim at work, where I actually had to use a text editor for a significant portion of my day (actually, ViEmu, at the time). For university work, I never used Vim for quite long enough for it to really sink in.
Sure, you lose most of your productivity for a few days when switching text editors. So, I guess you should not switch editors when time is at a premium and deadlines are piling up. But you certainly need to have a good amount of time where you use the software full time, if only to build those all-important habits.
By the way, this is how I learned Vim, Emacs, and (shockingly) touch typing. It worked well for me.