RubyMine (RM) is my favorite Ruby IDE. Vim is my editor of choice. Which one is best? I'm going to try to find out. Here are the features I will be judging on.
- Quickly find files
- Keep recently used files at my fingertips
- Autocomplete long variable and method names
- Do common VCS commands like diff and revert
- Supply a tree view of the project directories
- Jump to method definitions
- Text search
- Run Tests
- Debug
- Performance
- Cost
- Learning Curve
On its own Vim can't do many of these things, but thanks to some powerful plugins this will be interesting. You can find my entire .vim directory and my .vimrc
on githubThings to note- I'm using the rails codebase to illustrate my examples.
- I'm omitting installation discussion and ask you to refer to github if you need details on how things are configured.
- My plugins have keymappings that are setup to be reminiscent of RM/IntelliJ
- vividchalk is simply the best color scheme with desert256 a close second
Quickly find files
In vim I use the
fuzzyfinder plugin for this. In RM there is "Go To File" (ctrl-shift-n). Both of these pretty much just work, each one has nuances that skew things in their own favor so I'm calling this one a draw. Here is a screenshot of me finding base.rb in active_record with fuzzyfinder.

Keep recently used files at my fingertipsIn vim I use the
MRU plugin for this. It shows you a list of most recently used files and lets you quickly jump to one. I map this plugin to ctrl-e. RM has the same functionality. Once again a tie.
Autocomplete long variable and method namesIn Vim I use
Supertab for this and it is an amazing tool that nearly always offers good completions. By contrast RM ctrl-space often times offers no suggestions. Here is an example. Opening up active_record/base.rb to the respond_to? method in each app, when I begin to type DynamicFinderMatch, "Dyn..." and ctrl-space in RubyMine I get no suggestions. With supertab I get 3 suggestions: Dynamic, DynamicFinderMatch and DynamicScopeMatch. Below are some screenshots of Vim and Rubymine tab completion in action. Viva Supertab!

Do common VCS commands like diff and revertIn Vim I use the
vcscommand plugin for this. Mostly I do things like diff my working copy against the repository, revert files to pristine condition or look through the VCS logs. vcscommand does all these well, plus it supports more VCS systems including git, hg, and bzr, but Rubymine really shines because of it's excellent visual diff/merge tool. Winner RM. Here is a screenshot of vcscommand showing base.rb's commit history.
Supply a tree view of the project directoriesIn Vim I use
the NERD tree plugin for this. I find nerd tree to be just as good as the project view in RubyMine, though it is more difficult to use because I can't be bothered to remember all the nifty commands and shortcuts for doing things to the filesystem via the NERD tree. Edge RM.
Take me to method definitionsIn Vim I use exuberant ctags for this. This is a
standard vim feature, not a plugin. Ctags builds an index of your code that vim can use to navigate files. It works ok for standard ruby, but with lots of metaprogramming (rails anyone?) it really sucks. RM command+click offers much better support for this. Caveat, I think
rails.vim helps with this and lets you jump to related files (related controllers and views or models and migrations), but for jump to method and variable definitions RM is king.
Text searchYou can do inline grepping in vim with grep.vim, but I usually just grep from the command line. Once again this is an area where RubyMine has the edge. RM's collapsable search results that you can click through are powerful.
Run TestsYou can invoke tests from either one (though I don't have it setup in vim because I just use autospec which constantly runs my tests in the background). Still RM has pretty green bars and I'm a sucker for that. Edge RM.
DebuggingVim has a Ruby Debugger called
vim-ruby-debugger. Doing TDD I rarely find myself in need of a debugger so I haven't played with it. From the description and screenshots it looks as good as the RubyMine offering, so I'll give it the benefit of the doubt here and say tie or even who cares.
Performance
RubyMine gobbles up memory. 30 minutes of editing the rails codebase and it is using 703 MB of RAM! Vim is using 11 MB of RAM. RubyMine is slow to startup, and has occasional performance hiccups too. Vim wins.
CostRubyMine costs 100$ for a commercial license. Vim is open source. Good Karma. Vim wins.
Learning CurveVim requires you to know all sorts of arcane commands and to be really productive you need lots of plugins. So the learning curve is quite steep. RM has a much more intuitive interface and is ready to go out of the box. Edge RM
ConclusionOk, RM wins but with an asterisk. RM has the advantage of being completely focused on Ruby, HTML and JavaScript. It does one thing and does it well. Vim on the other hand will happily highlight and edit nearly every programming language or filetype known to man (or machine). 20 years down the road when Rails is a dinosaur, the new COBOL, and you have moved on to working in language X, your RubyMine skills will be irrelevant while the Vim you picked up might still be serving you well... But yea, most people will probably be slightly more productive in RubyMine. So what do you do? I don't know, so I say just learn them both and use them both.