santiago.pastorino

My Emacs for Rails 22

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

  13. Per Per September 07, 2010 @ 12:01 AM

    Did exaclty as you said. Running Emacs 23.2 (9.0).

    Get this when starting Emacs: Warning (initialization): An error occurred while loading `/Users/sondre/.emacs.d/init.el’:

    File error: Cannot open load file, textmate

    Can you help me?

  14. Santiago Pastorino Santiago PastorinoOctober 01, 2010 @ 07:58 PM

    We need some more information to help you. Probably i should give up with the maintainance of my_emacs_for_rails because lack of time. But definitely i will search for somebody to continue and give somebody commit access to keep up the work.

  15. Exchange Rate Exchange RateOctober 11, 2010 @ 05:45 AM

    Hey great article, thanks for sharing. Maybe look deeper at the generation of the form and what is being passed into it?

  16. angel angelOctober 21, 2010 @ 08:09 AM

    Hi…I’m newbie with emacs (before I used netbeans) and I don’t know how run it…I installed emacs, download your pack and put it inside /.emacs.d…what need I do now?...thanks…

  17. Mina MinaDecember 06, 2010 @ 10:26 AM

    hi, I tried to use this and it’s very usefull. The only problem is Rspec files. I am writing an Rspec file and it does not put the end for me automatically. I also doesn’t let me tab to indent the next line. Any ideas how to fix it?

  18. Prashant Sahni Prashant SahniMay 01, 2011 @ 11:55 AM

    Very Use full post, thanks a lot

  19. Raheel Hasan Raheel HasanJune 10, 2011 @ 01:05 PM

    I got a lot of errors from downloaded plugins/yasnippet This folder has a lot of issues when unzipping. I have reported the issues at your github account.

  20. Ajey AjeyJune 19, 2011 @ 08:39 AM

    The git clone url should be git://github.com/spastorino/my_emacs_for_rails.git and not what is mentioned in the blog.

  21. RisingSun RisingSunNovember 18, 2011 @ 05:55 AM

    Thanks! I’ve been struggling all week to get emacs to indent html.erb files. I created a new account on workingwithrails just to recommend you.

  22. Rima RimaNovember 28, 2011 @ 06:45 PM

    Where can i get a list of all the key bindings ?

Comment