Why I use vim
michaeltrier.com
michaeltrier.com
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.
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.
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.
It's true though that if you're heavily invested in vim plugins there's fair time sink in getting up to speed on the emacs equivalents. Everything's a tradeoff.
With that said I'm trying to use emacs org mode to keep myself organized, which works great! But I would never trade it with vim as my code editor, not in a million years. Sorry.
Still, unless you start using a vi emulation mode or keychords.el you will always be stuck with the meta keys. For me this was no problem since vi's modal approach to editing always rubbed me the wrong way. (I used Vim for almost 10 years before making the switch to Emacs.)
But I like the Vi input model so much that I want to be able to use it in Emacs. I've understood that "evil" is the preferred Emacs-Vi-input layer these days (instead of viper or other alternatives). I'm going to use Emacs 24.
Any suggestions for migrating from Vim to Emacs?
It wasn't the various alternate modes that enticed me so much as a more consistent buffer model for file-find, greps, and compiles. And I'm very happy not to have that constant "am I in insert or command mode?" problem. The control keys are now second nature.
Try, try again!
Yes, I use Emacs. And yes, I use Meta (Alt) keys sparingly. I think the only Meta-chord I use is Alt-Tab to switch applications.
Are you always so pleasant? Who pissed in your wheaties?
So what I really needed was a use case to make me use it properly. Once you see the awesome power of Org-Mode and try to imagine what else you could do, you see the potential of Emacs. After that, it is the all-too-well-known cycle of "This is rather tedious", "there has to be a better way to do this" and finally discovering yet another new keyboard shortcut.
Also, get into the habit of using isearch (C-s, C-r) as a replacement for many of the Vim search commands (fFtT/? etc.). This makes Emacs a lot more manageable if you are used to Vim motions.
But really, I don't feel the need to use only Emacs or Vim. I switch freely between them depending on the task at hand.
That said, I did and do have trouble getting over the fact that Emacs seems to be unable to handle mousewheel-scrolling properly and has rather poor support for code folding. Not deal breakers, those, but come on, this is 2012!
I think this exemplifies this: http://vimdoc.sourceforge.net/htmldoc/tips.html#shell-window
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.
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.
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.
Not having to think about where the buttons are that I have to press to accomplish something, not having to leave the home row... that's comfortable. While I'm sure I'm faster doing the same tasks with vim than I would be using a regular editor, the comfort of not having to consciously think about what I have to do is clearly the bigger one.
Then, head over to #vim on freenode.net with any questions. Even simply lurking in that channel is a great education.
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.
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.
Right now left is :bp and right is :bn to move through my active buffer.
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)
"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."