jEdit, Cream, Gvim, and vim for Ruby on Rails

jEdit for Ruby on Rails

I recently mentioned that I like jEdit for Ruby on Rails. I added the Ruby plugin for jEdit (which can be installed directly through the jEdit plugin manager). There is also a plugin called SuperAbbrevs that allows you to create typing shortcuts for Ruby on Rails (or any other language). The screenshot below shows the Ruby documentation displayed on the right side of jEdit. The jEdit Ruby plugin also has a method completion feature but I couldn't get a clean screenshot of it.

jEdit Ruby plugin

The main problem that I'm having with jEdit is that it is slow on my machine (Ubuntu on a 1GB ThinkPad with 1.87 Centrino processor).

Cream, Gvim, and vim for Ruby on Rails

I'm also experimenting with Cream and gvim for Ruby on Rails. If you are using Cream (a non-modal version of gvim with scripts added), turn on "Expert Mode" as shown below:

Turning on expert mode in Cream (gvim)

Expert mode allows you to use the vim modes with the ESC key.

Then install the Ruby on Rails script for vim (also available here).

In vim, or in Cream with Expert Mode enabled (ESC key), type :Rabbrev. That will give you a list of all the Rails abbreviations as shown below:

Rails abbreviations on Cream / gvim

Now when you open a file in a Rails project, you can just type (for example) rp( (or just rp and the TAB key), and Cream/vim/gvim will automatically turn it into render(:partial =>. The Ruby on Rails plug for vim also has many other features including easy navigation of Rails projects. One feature is the ability to take part of an .rhtml file and create a partial with just one line like this: :7,9Rpartial post. That would take lines 7 through 9 and put them in a file called _post.rhtml, and replace those lines in the original file with the following:

<div>
<%= render :partial => 'post' %>
<div>

Documentation is included with the plugin so check it out. More information on using vim for Ruby on rails can be found on the Ruby on Rails Wiki.

Currently Leaning Towards Cream (gvim)

For editing Ruby on Rails files on Ubuntu, I'm currently leaning towards Cream (gvim) with the Ruby on Rails plugin. It runs fast, has good syntax highlighting and indentation for Ruby on Rails files, and now the additional features of the Ruby on Rails vim scripts.


Comments

what about easyecplise?

hello, i am at the very beginning of this "rails"... i saw there is a distribution of eclipse, called easyeclipse for ruby and rails, or so...

what about that before i dive in?

thank you very much to you all

syb

Webmaster Tips's picture

easyeclipse and ruby on rails

Hi,
I haven't tried easyeclipse. I'm using Gvim for just about everything at the moment. Easyeclipse might be worth installing and trying...

thanks! :-)

ok, i will give it a try! and if i will success in something, i will let you know

i appreciate so much your help

and let me say this is really a great website, one of the best i know, in general, most of all (but not only) under a functional design perspective

and what a cool bunch of useful and funny stuff! :-)

c u

syb

Syndicate content