8 ms·
Why I use vim
- pacomerh 15y agoThe speed increase on paragraph editing capabilities is really attracting versus pointing your mouse to do everything. I'm gonna give it a shot, thanks.
- gnosis 15y agoIf you're just starting, I strongly recommend you go through vimtutor. After installing vim, just type "vimtutor" in your shell. Then, head over to #vim on freenode.net with any questions. Even simply lurking in that channel is a great education.
- rickyc091 15y agoIt took me two weeks before I finally grew comfortable with vim, so don't get discouraged. Start off by treating it as a regular text editor. Use the arrow keys to move around, use control (windows) or option (mac) + arrow keys to quickly move between words, etc. Slowly introduce a few vim shortcuts at a time. It was also helpful for me to write the commands on a whiteboard or a post it and have it on my monitor as reference.
- re_todd 15y agoYeah, having them written down off to the side helped me finally learn vim. There are many vim cheat sheets out there via a quick google that I wish I would have used starting out.
- wyclif 15y agoThis is helpful, particularly the resources listed, but I would advise against using someone else's config starting out. Continually editing my own .vimrc for the first few months was a big part of learning. If you use someone else's dotfiles right from the start, there's a good chance you'll end up believing some behaviour is default when it really isn't, and that's going to mess you up.
- aklein 15y agoThat was a huge mistake for me when first learning vim. If you start with someone else's .vimrc, you will run into a lot more "FML, what is going on" experiences that you should.
- alwillis 15y agoAgreed. There's a great post Vim: revisited with a minimal .vimrc file that I used after having to start over learning Vim because of using someone else's .vimrc I didn't need or fully understand: http://mislav.uniqpath.com/2011/12/vim-revisited/ http://mislav.uniqpath.com/2011/12/vim-revisited/
- deleted 15y ago[deleted]
- lelele 15y agoWell, when I started using Emacs, I copied a lot of snippets of code which I didn't understand, and it didn't hamper my learning process. Quite the contrary, it sped it up because I was able to override some annoying behaviors before learning how to do it.
- notJim 15y agoI agree with this very strongly. The first time I tried to learn VIM, I installed janus [1], and ended up with this monstrous, complicated system with a million plugins that I didn't understand. The mouse sort of worked, but not the way I expected it to. I'm now sort-of trying to learn VIM again. My vimrc has about 10-15 lines in it, and I know what each one does. I have a color scheme installed, but no other plugins. How I boosted my Vim [2] has been helpful to me in adding things to my vimrc, because Vincent Driessen is, as always, clear-minded and erudite in his description of what things do, and has good taste on a basic setup that will make sense to the modern developer. Again though, I haven't blindly pasted in all his stuff—instead, when I feel some friction with my Vim settings, I head to that article and see if there's a tweak he's listed that I can use. [1]: https://github.com/carlhuda/janus https://github.com/carlhuda/janus [2]: http://nvie.com/posts/how-i-boosted-my-vim/ http://nvie.com/posts/how-i-boosted-my-vim/
- tdenkinger 15y agoThere's a bad link in the article. The link to "Vim My new IDE" should be: http://justinlilly.com/vim/my_new_ide.html http://justinlilly.com/vim/my_new_ide.html
- dbbo 15y agoEvery week there's some post like this, or "why I switched back and forth between Vim and Textmate 17 times", and, frankly, I just don't see the merit in it. Are you trying to get other people to use the editor you like?
- gnosis 15y agoFrom the HN Guidelines: "Please don't submit comments complaining that a submission is inappropriate for the site. If you think something is spam or offtopic, flag it by going to its page and clicking on the "flag" link. (Not all users will see this; there is a karma threshold.) If you flag something, please don't also comment that you did." http://ycombinator.com/newsguidelines.html http://ycombinator.com/newsguidelines.html
- manojlds 15y agoThe article should have been named "I use vim". Where does it explain the why?
- farnsworth 15y agoExactly. Just vague rambling about how it's so great and different. The links are interesting, though.
- noveltyaccount 15y agoI used to use Vim, and then I got a job after college working with .NET (this was in 2003). Since then I've used Visual Studio as my primary IDE. Its features (or that of Eclipse) seem to (pardon the pun) eclipse the crap out of Vim. The contextual information you get in VS by hovering your mouse on any variable, the built-in debugging, etc. Studio isn't a just text editor, it actually understands the semantics of your programming language, it helps you write better code faster.
- rodh257 15y agoYou can get VsVim to use vim like editing inside of Visual Studio, which may give you the best of both worlds?
- Roboprog 15y agoFor Java, NetBeans + vim plugin does just that. Major win. Same editor (almost, plain old vi) in impoverished production environments, full vim under cygwin for quick patches, and the same keystrokes in my IDE with all the other goodies for long term projects.
- drhowarddrfine 15y agoYou need all that to figure out the 20K+ functions/libraries/system calls to get anything to work. If you need all that, use emacs.
- anykey 15y agoAnd that is why VisualStudio is considered an IDE rather than an editor. As with the rest of the *nix toolkit, the philosophy with Vi(m) is to do one simple thing (editing) and do it really really well, for better or worse. I think this exemplifies this: http://vimdoc.sourceforge.net/htmldoc/tips.html#shell-window http://vimdoc.sourceforge.net/htmldoc/tips.html#shell-window
- noveltyaccount 15y agoI fundamentally agree that doing less and doing it well is a virtue in software, but people don't "just" "edit text." When I edit text I'm either writing a document/web page (where I need to format it in addition to editing the text), or writing code (where I need to debug and test it). I still use Vim when I ssh into my firm's Linux server and I'm so glad that it works--so well--over a remote session. But for actually writing a program, I'm happy to have a proper IDE.
- ricardobeat 15y agoI'm usually one to complain of the opposite, but 21px is quite an exaggeration for body text, isn't it? Limiting body width to ~800px would help too.
- jvm 15y agoYeah those letters are bigger than my fovea. Someone else posted the instapaper version, big improvement.
- whalesalad 15y agoEasier to read: http://www.instapaper.com/text?u=http%3A%2F%2Fmichaeltrier.com%2F2010%2F12%2F05%2Fwhy-i-use-vim%2F http://www.instapaper.com/text?u=http%3A%2F%2Fmichaeltrier.c...
- adam_albrecht 15y agoI love Vim and have been a happy MacVim user for a while now. But I just started using Vico and I am really liking it. It's definitely missing a lot of the features that Vim has accrued over time, but the native UI and polish of Vico has me using it full time now. http://www.vicoapp.com/ http://www.vicoapp.com/
- jwallaceparker 15y agoThanks for the recommendation. I love testing out text editors. I've been migrating back and forth between TextMate 2 and Sublime Text 2. Looks like Vico will now be part of the rotation.
- oinksoft 15y agoHm, I used GVim/MacVim for a few years and was very comfortable with it, but the more I was doing heavy editing on remote machines, or even Linux VMs on my local machines, the more GVim felt like a crutch. I now will only use terminal vim and I can't imagine going back. It's very nice being able to have the same editing experience as long as I can SSH in. And sshfs etc are not solutions due to the need for shell integration and the problem of latency on write. An added benefit is that all of my heavy applications live in the console, making it much easier to keep things organized, especially when I am using screen.
- mattmiller 15y agoI am stuck with windows and cygwin. Is there a way to run vim without the weird bugs? I run rxvt and still see a lot of weirdness with vim, I really only use it for quick edits. I would love to put in the time to learn it better, but I don't want to suffer through weirdness on top of the learning curve.
- anykey 15y agogVim runs just fine on windows, although I cannot speak for the terminal equivalent.
- MatthewPhillips 15y agoWorks the same as on UNIX. No need for cygwin.
- Karunamon 15y agoSo has anyone ever been a die-hard vim user, been absolutely seduced by Emacs and the wealth of things that go with it (IRC? Org mode? Holy crap!), tried to use it, and been completely turned off by the abundance of control keys? This describes me. I really, really want to like Emacs and learn to use it, but coming from vim, such heavy use of the meta keys just feels wrong.
- disnet 15y agoYep, but I managed with viper and vimpulse [1] which give vim bindings in emacs. You can have your cake and eat it too :) [1] http://www.emacswiki.org/emacs-es/Vimpulse http://www.emacswiki.org/emacs-es/Vimpulse
- gnosis 15y agoI'm a die-hard vim user, who's used vim for many years. I tried emacs with viper and vimpulse recently, and found that while they did make emacs a lot less painful, they were a far cry from making a long-time vim user comfortable in emacs. The biggest problem is that in order to configure emacs and bind functions to keys you have to invest a lot of time in reading documentation and finding out about emacs. If you have that sort of time to invest, great. But I didn't, especially since I already know vim very well and feel completely comfortable using and configuring it. Switching to emacs just didn't seem worth the time investment in my particular case. I have heard that evil was a better vim emulation mode for emacs, and I've been meaning to give it a try, but haven't gotten around to it yet -- and I'm still skeptical of it addressing my main concern, which is that to really use emacs effectively (even in vim emulation mode) you'd have to invest a lot of time in learning the emacsy parts. There is one other major issue that none of emacs' vim emulation modes address, which is the thousands of vim plugins available on www.vim.org. You might, in the best case, get all the standard vim keybindings for emacs, but you'd still be forced to use emacs scripts and plugins, instead of the vim scripts and plugins you like and are used to. Learning and transitioning to those is yet another big time sink right there. One of the main reasons that I switched to emacs was to use SLIME to interface with Common Lisp. But SLIME is a huge program, and learning to use it and configure viper/vimpulse to bind keyboard shortcuts to its functions requires spending a lot of time learning about and understanding SLIME. It's just so much simpler to one of the less feature-rich vim plugins to develop code in CL. Yes, you'd miss out on some great SLIME features, but you would also not have to spend a ton of time learning SLIME and configuring viper/vimpulse to work with it.
- makepanic 15y agoWhile learning vim it was really helpful to rebind the left/right arrow keys to change my cursor moving behavior. Right now left is :bp and right is :bn to move through my active buffer.
- yogsototh 15y agoThank you! Never thought about these.
- richardk 15y agoAm I the only person who thinks it's absolutely insane how much time people spend learning to use an editor? Am I really supposed to believe that my time is better spent learning an editor than it is spent getting better at programming? I honestly feel that learning these editors has more to do with gaining status than it does self-improvement. Why should I have to spend hours consciously learning an /editor/. It's /just/ an editor, the interface should be good enough that I can just walk in and use it productively from the start. For the record, I used vim for the first 2 years of my degree, now I use gedit. It certainly lacks some functionality, but it's generally good enough and feels like much less of a burden to carry: I'm free to focus on actual work.
- justanotheratom 15y agoPersonally, I have spent a lot of time customizing and mastering Vim. But I agree with you that mastering a powerful editor is not a sufficient condition to be a good programmer. That realization occurred to me after I found that a few programmers that I respect very much have very primitive editing skills (which was very difficult for me to swallow at first).
- zem 15y agoit's not even a necessary condition. it has, however, made my life a lot more comfortable and pleasant, given the amount of time i spend entering text into a document and then editing it in various ways. there are things that i can do almost without thinking about them in vim that would involve effort, tedium or both if done any other way.
- roel_v 15y agoI'm not sure the many hours I spend 10+ years ago learning vim are really worth it, when compared to the amount of time I saved during editing. However: 1. I had a consistent editing experience for those 10+ years, and expect to have it for decades to come - vim is everywhere, and it works the same everywhere (well at least if you stay away from things that may not be time-proof, like plugins that rely on Python support). It gives me peace of mind - it's a stable factor amongst things that tend to change every 6 months, usually for no good reason. 2. I have a comfortable editing experience, one that is so ingrained that it has become transparent (meaning, I don't notice it any more, like a good pair of shoes that are so comfortable you don't notice wearing them). When I use Visual Studio on a machine with no Viemu installed, there is this continuous nagging feeling that the editing is so sub-optimal. Again I don't know if the time I spend learning vim is objectively justified when compared to the annoyances of the editing in 'plain' editors, but it certainly made for a great quality of life improvement. I got to go everywhere I wanted to go with my old Citroen, and it was (quite a bit) cheaper than the BMW I drive now, but I still very much like the BMW's improved comfort and joy of driving. Is it objectively a net for me to drive a BMW? I suspect not, the objective marginal value I get out of it over the Citroen is low, but it's worth the money (where for the sake of comparison with vim, money = time) to me.
- StavrosK 15y agoI have no idea why I keep using Vim. These past few days I've been trying to switch to Eclipse for coding, as it has all the bells and whistles, but as soon as I need to open another file in the editor, I find myself switching to the command line and opening it in Vim, wondering why the hell I did that with Eclipse open. I think it just comes down to speed, in the end. I can switch to Vim and open the file in the time it takes Eclipse to go from ctrl+T to the "find file" dialog. Code completion, refactoring, autoimports, etc are great, but I manage fine without them. I'll continue the experiment and see.
- Confusion 15y agoI'm using RubyMine with the vim plugin for Ruby coding. That's just awesome: all that's good about an IDE with a lot of what's good about vim.
- StavrosK 15y agoInteresting, does anyone know of something similar for Python? I have PyLint (I think?) and it points out errors as I type, it's great.
- actf 15y agoAs someone who loves vim I'm both surprised and curious that he mentions using vim to write .NET code While I love vim, I can't imagine using it to write anything significant in .NET - the lack of auto completion and an integrated debugger is a deal killer for me. I'd love to hear the author, or anyone else, elaborate on what kind of setup they use for writing .NET code in vim (note that I already use the vim plugin for VS, I assume this isn't what the author is referring to though)