9 ms·
Everyone Who Tried to Convince Me to use Vim was Wrong (2010)
- pekk 14y agoSo actually it isn't that they were wrong in general, it is that it is possible to get into vim incrementally and customize it to suit your needs.
- deleted 14y ago[deleted]
- rtfeldman 14y agoIt's sad to hear you had that initial experience. The person who got me into Vim recommended more or less what your friend did: start by getting a setup similar to my current editor, except with Pandora's Box just an Esc away. Then let curiosity run its course. 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.
- PaulHoule 14y agoI switched from emacs to vim because I've found that vim-in-a-terminal-window works better when I'm also using GUI editors. In particular, cut-and-pastes don't get screwed up by continuation characters like they do in emacs. 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.
- pekk 14y agoIt's really nice to have the option of terminal or GUI, and the same editor across platforms.
- SkyMarshal 14y agoHave you tried emacs -nw ? I use vim in terminal windows by default, but have been curious about how emacs's terminal mode compares.
- eranation 14y agoThis helped me with the basics - http://www.openvim.com/tutorial.html http://www.openvim.com/tutorial.html it's an online interactive "try vim" kind of tutorial I wonder if there are more things like this
- johncoltrane 14y agoIf you are using a UNIX-y OS, you most likely already have vim and vimtutor. If yes, that site is worthless.
- koenigdavidmj 14y agoVim is sort of like C++: everyone knows their little subset of it, and everyone knows a different subset. It's common to watch another Vim user do something and be like, "how did you do that!?!?". And it's in their muscle memory, not their conscious memory: they need to repeat it and watch which keys they hit.
- MetaCosm 14y ago2010.
- Kaivo 14y agoIt's exactly the process I'm going through right now. Just finished a small project using vim and haven't installed any plugin so far. I already got the reflex to :w and such in others editors. I've read at a few places to learn one command at a time, and it seems better this way. Otherwise, you need cheatsheets and man pages to figure out how to do things, while it should actually be done intinctively.
- abraininavat 14y agoThe key piece of advice you were missing is "Don't try to learn vim at work." 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.
- marssaxman 14y agoWhy bother? You're not going anywhere any faster, and the ancient automobile you're clanking along in takes just as much maintenance as the horse did.
- abraininavat 14y agoFor one, there are automobiles (vim) everywhere. I can't take the time to install a horse on every remote server I use.
- marssaxman 14y agoWell, that makes sense. I can imagine that someone whose job involves ssh'ing into a lot of remote servers and doing configuration things to them might have very different needs than a typical software developer does.
- pekk 14y agoIf people want to use vim in a "watered down way" then let them, it's better than rejecting a great tool because they can't fulfill a critical work need
- jeremyjh 14y agoSo now I know about the existence of ci " . I feel like half my life has been wasted by not knowing it.
- qdog 14y agoHah, no doubt. Not sure if it's good or bad each "I just learned vim" article has some random command I'm totally unfamiliar with I can't believe I haven't used. Obviously I'm just a vim user, not a power user.
- w0utert 14y agoYou should never listen to anyone advising to use only bare-bones console vim without the mouse or cursor keys, it's simply masochistic and doesn't contribute to your efficiency learning vim at all. Only if you expect to ever be using unix vim remotely through a terminal you should be aware of hjkl for navigation and visual mode for block selections. Any other constraints you impose on yourself are philoshical, if all you want is vim on OSX/Windows/desktop Linux. 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.
- mauvehaus 14y agoSome of us do use bare-bones console vim because we're using it remotely through a terminal. Or because, god help us, Solaris still doesn't install vim by default and we're stuck using plain old vi (at least on a customer's server, where I can't just go and install vim). 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.
- gnosis 14y agoJust play some nethack, and you'll be completely comfortable with the hjkl movement keys in no time.
- marcosdumay 14y agoI just can't use them. I activate the number-pad every time I play. That said, I'm more of an emacs guy.
- qdog 14y agoYep, having to play Crawl a few minutes a week is like piano lessons for my son now ;) Someday he'll understand why.
- jlgreco 14y agoI did this, then I started missing the yubn diagonal movement in vim. ;)
- saurik 14y agoI really like Yehuda, but I must say that I always found this article personally annoying: I was one of those people trying to convince Yehuda to use vim (going way back to like 2006 when we lived in the same town and I was consulting for a company he worked at), and was probably one of the earlier people to really argue with him about using vim, and I can guarantee I wouldn't have said any of the things in this article. 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.)
- marssaxman 14y agoWhat are these people doing that makes such miniscule micro-optimizations of text-editing performance matter so much? 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.
- mindstab 14y agoSounds like a classic case of pg's "Blub paradox" http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html
- pacala 14y agoI don't see the similarity. Would you please substantiate your claim? 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?
- disgruntledphd2 14y agoOK, I'll bite. I am a sometime programmer, mostly a data analyst. I acquired Emacs less than two years ago, mostly because it could highlight both LaTeX and R code for me, and allowed the evaluation of R code in an attached buffer. 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.
- ritchiea 14y agoIf you have 15 minutes and you're interested in vim, go to your terminal or unix shell & enter the command vimtutor. 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 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.
- kybernetyk 14y agoMy dirty little secret: I have been a vim user for over 15 years now and I still use the arrow keys. :)
- MatthewPhillips 14y agoI've been using vim for a few years and I still use the arrow keys; see no reason to ever stop doing so. Too many people treat their text editor of choice as a religion and see the need to prove their devotion by embracing every difference it contains.
- jamesbritt 14y agosee no reason to ever stop doing so. 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.
- jamesbritt 14y agoMuch more popular this time than when previously submitted about a year ago: https://news.ycombinator.com/item?id=4088248 https://news.ycombinator.com/item?id=4088248 And three years ago: https://news.ycombinator.com/item?id=1559074 https://news.ycombinator.com/item?id=1559074
- bb0wn 14y agoAlso, pretty sure this has been posted before, but http://web.archive.org/web/20070814184957/http://www.moolenaar.net/habits.html http://web.archive.org/web/20070814184957/http://www.moolena... is a great collection of tips for making vim pay dividends.
- account_taken 14y agoI think some of us die hards push the pure vim way too hard. For example, while in insert mode `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.
- gesman 14y agoThe most productive editor must takes minimal number of physical actions (like keys to be pressed) to achieve desired result. 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.
- gfodor 14y agoI was fortunate enough to pick up vim in my teenage years on the job where I worked on remote unix machines. I still learn new stuff all the time but using vim is kind of like speaking, breathing, or typing to me at this point, and I don't really remember the initial learning and struggling phase anymore. I feel pretty lucky in this and a) I don't care if other people use vim, really and b) I have a tough time empathizing when people who want to use it get so emotional about how hard it is to learn. It's kind of like hearing someone complain about how difficult English is or learning to type and getting in debates over if it's worth learning. To me it's pretty obvious that I could not live without it. But arguing about it is irrelevant to me and I can only sympathize in the most abstract way because I don't really remember "learning" English or typing. But I'm sure it would be extremely hard to pick up at this point in my life from scratch.
- narrator 14y agoI used to develop Java in emacs. I gave that up and moved to Eclipse but I still use emacs whenever I have a blob of unformatted text that I need to chop up and manipulate. It does that better than just about anything. One cool thing about emacs is it doesn't care if you have a 30000 character long line while most editors will choke badly on that.
- jondot 14y agoThis is a great article. It made me move to Vim after years of replacing and optimizing every component between my brain and my code. 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!
- fishtoaster 14y agoMost people I've talked to who've gotten into vim have gone through the exact opposite flow: 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).
- j45 14y agoThis belief that because you use something, everyone else should too is so self-involved it's not even funny anymore. _________________ 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.
- AJAlabs 14y agoIt's simple. TextMate 2 for your GUI editor and vim when you need to ssh into a remote box. All of my remote machines have rmate installed so it's TextMate 2 90% of the time unless I need to use NERDtree and that's where vim is handy.
- snambi 14y agoVim is an awesome editor. its not that hard to learn. i used the man pages to learn vim.
- SurfScore 14y agoI can understand the utility of vim, but I've never understood the argument about being able to churn out code so much faster. Sure there are times when I'm head down hacking away like some movie, but so much of my time is spent thinking, reviewing, doing minor refactoring, and just plain looking at what I've written. 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.
- ChuckMcM 14y agoStrangely perhaps I first used FINE (FINE is not EMACS) but there was this cool game called rogue [1] and rogue used the hjlk (and HJLK) keys to move around the maze. Playing for hours trained my fingers, and when I opened up vi for the first time someone said "Oh, just move around like you do in rogue" and literally I just needed to think where I wanted the cursor to be and my fingers made that happen. Strange way to learn those keys but it worked quite well. [1] Which you may know as 'hack' or 'nethack'
- thisrod 14y agoThis post set me thinking about why I prefer acme to vi. They're both derived from ed, and nowadays they both know about the mouse. So how do they differ? 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.
- martinced 14y agoMost non-vim / non-Emacs users are actually doing post-fact rationalization: you never hear, say "Text editor Blub is faster to edit text than Emacs/vim". What you hear them say is "You don't need to edit text fast, most type spend coding isn't spend typing but thinking". That is 101 post-fact rationalization: they try to justify the fact that they fully know their editor isn't faster to edit text by explaining that no one should care about the speed it takes to edit text. This is silly beyond imagination. In a way I'm glad such people aren't part of the vim / Emacs community because you can't really have a meaningful discussion with these people: they're trying to shift the topic. Appeal to authority: I suggest reading Paul Graham's "Beating the averages" and "Being Popular". Then come back arguing but please cut the post-fact rationalization dishonesty. FWIW I'm using IntelliJ IDEA since version 4 or so (bought version 12 during doomsday 75% off but didn't even install it yet)... Yet I spent nearly all my coding time inside Emacs. As soon as you start to write Lisp / elisp to adapt Emacs to your workflow (and not the other way round), a whole new world opens to you. Yup. Mainly a Java dev here and I haven't even yet installed IntelliJ 12 seen that I'm always under Emacs. I figure out that during some crazy refactoring session IntellIJ may come handy due to Java / Visual Blub's extreme verbosity and redundancy and countless lines of unnecessary code that can be generated automatically (really highlighting one of the many Blub flaws)... But I prefer to code.
- B5geek 14y agoWhile all the hard-core programmers and coders around me use vim all the time they ridicule me for using nano. 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.