A new editor for RoR development
Hence the name, RoRED. Unfortunately, I’m in a Windows environment (although I don’t know that for sure, as I’ve never used a Mac). Aside from many other Windows drawbacks, I’m unable to get Textmate, which I’ve heard a lot about. I’ve been using RadRails for the past few months, but now it takes forever to load. I came from PSPad, so I was used to that quick, easy editing. I’ve been reluctant to even open RadRails lately, and that’s not how it should be. That’s a mood killer is what that is.
I figured there were more editors out there so I began to look around. I tried jEdit, but came across a few problems that led me in the opposite direction. Then I found RoRED. It’s light-weight and has a few nice features. Features that promote productivity, which are the kind I like. It supports this MVC view, where it groups models, views and controllers in a smart tab type of interface. I think I like it. Also, it supports a “go to definition” by CTRL+Clicking on a method name, which can be handy. One thing I knew I wanted in my next editor was autocomplete functionality, which it supports. An autocomplete (or abbreviation) let’s you type a pre-defined string of characters and transform that string into a block of code that you’ve set by hitting something like CTRL+ENTER or SHIFT+SPACE. For instance, a recent one I’ve added:
1 2 3 4 5 6 7 8 9 10 11 12 | # simply type: dtxs SHIFT+SPACE # to get: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title></title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="Author" content="Ryan Heath" /> </head> |
I chose dtxs for “doctype xhtml strict”. So by typing four little letters and hitting SHIFT+SPACE, I get all of that code with my cursor blinking between the title tags. I know this has been around for a while, but this will be my first encounter with any form of autocomplete or abbreviation(s). One thing I don’t like is the fact that you can’t tab your cursor to the next marker (place you need to type) like you can in Textmate and jEdit. For instance, I have one for link_to. Well, a link_to has at a minimum a name and action, but I cannot mark the spots for both. Here’s what it takes to define the abbreviation in RoRED:
1 2 3 4 5 6 | # How to define the abbreviation: [lt | creates a rhtml link_to with action only] <%= link_to '|', :action => '' %> # Once defined, type "lt SHIFT+SPACE" to get: <%= link_to '', :action => '' %> |
Notice the ”|” between quotes in the definition? That’s where your cursor will go after typing lt SHIFT+SPACE. If I were to put another ”|” in the quotes for the action, it would literally show up and I’d have to remove it and type my action name. Where in other editors, you can do something like:
1 2 3 4 5 6 | # How to define the abbreviation: [ltcai | creates a rhtml link_to with controller, action, id] <%= link_to '$1', :controller => '$2', :action => '$3', :id => '$4' %> # Once defined, type "ltcai SHIFT+SPACE" to get: <%= link_to '', :controller => '', :action => '', :id => '' %> |
So your cursor starts out where the $1 is, but you can tab directly to the next spot in line filling it in as you go. It’s hard to imagine me complaining already, but I think I really will want that functionality. It seems that I’m inadvertently trying to get rid of my mouse altogether. Anyway, overall I think RoRED will be a nice switch for a while.
