Use MacVim and rails.vim plugin to edit your Rails work
Posted by Massimo Sgrelli in
Ruby on Rails -
6 comments
A couple of years ago I bought a copy of TextMate, the preferred and “exclusive” text editor of Ruby on Rails community. Two years ago I was a newcomer to Ruby language and Rails framework and TextMate helped me to enter quickly in this marvelous world. Coming back to then I chose this editor because on Rails official web site there weren’t others good suggested tools.
NOTE THIS: actually checking on the site, a few things are really changed. I read, “The entire Rails core team is using TextMate on Mac OS X. It’s a fantastic editor that ships with Ruby on Rails highlighting and macros”. I know it’s not true (Jeremy Kemper must is actually using a different tool).... is it some kind of hidden advertising?
In any case the Macromates product is definitely a good one, but soon I felt I needed something different, something I could suggest to my colleagues, to my friends, without force them to invest 30 bucks or so. I needed something like vi... vi?
Now vi has been replaced by vim.
VIM (an improved version of vi) is already installed on OSX or on Ubuntu and it’s free. But to be used as my preferred Ruby and Rails text editor I needed it could manage 2 things:
- some sort of integration with Rails (how?)
- syntax coloring TextMate-like (yeah, I like it)
No problem: the first issue has been trivial. You need to download rails.vim and extract the zip file to ~/.vim directory. This completes the installation :)
For the second issue wanted to have IR_Black theme (the theme I’m using under TextMate) on VIM too. This is how it looks like under TextMate:

... and you know what? It actually exists for VIM. Todd Werth, the creator of IR_Black theme for TextMate made it available for the Unix text editor. So I downloaded and put it under ~/.vim/colors directory, I launched vim and…

... this screen showed. From the shell, in the xterm, you have access to 16 ANSI colors only, so forget the full color result. I didn’t know that.
So? No fancy colors under VIM?
The solution is to download MacVim a project under the Google Code site, that easily access all the colors, using all the previous settings already stored under your ”.vim” directory.
The final result is awesome:



Comments
Tim Harper
Posted on August 15
Massimo Sgrelli
Posted on August 15
Tim Harper
Posted on August 15
Lisa Seelye
Posted on August 16
Mark Wilden
Posted on August 16
Adam
Posted on August 22