santiago.pastorino

My Emacs for Rails 12

Posted by santiago.pastorino
on Friday, September 11

I’d like to share with the community my emacs init file and a set of plugins to give a nicer experience on Ruby on Rails development, which you can checkout from http://github.com/spastorino/my_emacs_for_rails/tree/master. I have been using this environment under emacs 23, and it has not been tested on other emacs versions, so all feedback is welcome, if something goes wrong please feel free to contact me.

What’s in the package?

The package provides my customized Emacs init file and some plugins I found very useful to enhance Ruby on Rails development experience.

Plugins

Installation

Before you can use some plugins you have to install a few packages:

To use rcodetools you need to install the rcodetools, gem with
sudo gem install rcodetools
To use autotest you need the ZenTest gem, install it with
sudo gem install ZenTest
On further post I’m going to explain how to set it up under the gnome environment using all the beauty that gnome-notifier has. Checkout the package
git clone github.com/spastorino/my_emacs_for_rails
and copy all the files under my_emacs_for_rails directory to ~/.emacs.d directory if it doesn’t exist you have to create it.

Screenshot

You can see here some screenshots to get a taste of the look and feel that this one has.

|

If you have found this material to be useful, you might
consider recommending me on Working With Rails.

Comments

Leave a response

  1. Fabio Hisamoto Fabio HisamotoSeptember 16, 2009 @ 02:30 AM

    Very nice ! The first emacs configuration that runs smoothly with rails.

  2. Mig MigSeptember 18, 2009 @ 01:23 AM

    Very cool, it’s nice to see people in the rails community sharing their emacs configuration. I can’t figure out wether or not I like the ECB or not. It’s handy, but a little slow.

    Have a look at my emacs for rails dev config: http://github.com/mig/emacs-rails-kit

    Thanks

  3. Peter Barszczewski Peter BarszczewskiOctober 24, 2009 @ 04:13 PM

    Nice article, thanks for sharing.

    Have you been able to get rdebug to work with rails? Have you been able to integrate it with emacs’ gud (grand unified debugger)? Thanks.

  4. Santiago Pastorino Santiago PastorinoOctober 28, 2009 @ 12:32 AM

    Peter, you can integrate it with rdebug. All you have to do is M-x rdebug and perhaps you want to run with rdebug—emacs 3—no-stop PATH_TO/script/server And of course manage your breakpoints as usually.

  5. Neil NeilNovember 18, 2009 @ 05:56 AM

    Very nice indeed. I’ve been hoping to turn emacs into a decent RoR IDE for some time. Thanks for sharing.

  6. Jonathan Badger Jonathan BadgerNovember 18, 2009 @ 07:16 PM

    How do you get code completion the way you show in the screenshot? Is there some key to press or something? I’ve installed the packages, and I think it’s working (I get highlighting, file and method browsers etc) but I don’t seem to get code completion

  7. Santiago Pastorino Santiago PastorinoNovember 25, 2009 @ 11:49 PM

    The autocomplete shown in the screenshot is done automatically while you type, basically by searching for existing snippets and words previously written in the file. There are more advanced ways to autocomplete. I’ve put together some shortcuts that are executed by pressing ctrl+meta+i and ctrl+meta+o, but they are not inline and not too confortable. It would be great to have an autocomplete this way but inline, i invite you to give it a shot and send a patch :). I recommend you to pull my latest changes, probably it will work.

  8. Curtis K. Gwapo Curtis K. GwapoJanuary 12, 2010 @ 03:06 PM

    Thanks for putting this together. Greatly appreciated. I actually just made the switch from textmate to emacs. I was scouring the internet looking for some resources and I found this.

    Epic.

  9. Bill Vatikiotis Bill VatikiotisFebruary 04, 2010 @ 03:38 PM

    Thanks for this beautiful compilation. Is there something wrong with flymake? I keep getting configuration errors from it. I tried changing the temporary-file-directory variable but the error persists and flymake gets turned off.

  10. Santiago Pastorino Santiago PastorinoFebruary 12, 2010 @ 12:04 AM

    Bill, there’s nothing wrong with flymake on my end, but for javascript flymake use rhino which requires Java, perhaps you’re getting error with that?

  11. johnboyd johnboydFebruary 22, 2010 @ 02:34 PM

    hi. I’m having trouble finding what is ruby-block for

  12. Santiago Pastorino Santiago PastorinoMarch 24, 2010 @ 03:08 PM

    ruby-block tells you when you step on an end which is the corresponding beginning

Comment