I really like TextMate on my Mac Book Pro. And, I really like using TextMate for Ruby on Rails, it’s just such a good fit. However, most of my students are using Linux or Windows. After getting asked many, many times for a recommendation for something like TextMate I have written up this article for using my old favorite editor jEdit
First, you have to download and install jEdit for your operating system. I’m using version 4.3pre9 for these instructions. Then install the usual collection of plugins that make jEdit really usable. Here is a good list to get you going:
- Common Controls
- Info Viewer
- XML Indenter
The first step on the journey is to be able to quickly and nicely change the look of the editor. The plugin Editor Scheme Selector makes this happen. Install it from the Plugin Manager. Once installed select it from the Plugins menu. It will display a nice list of schemes, try them out! You can also download more from here including one suspiciously named “TextMate-like Editor Scheme”.
On of the nice features of TextMate is the “Go To File…” command which is mapped to command-t. The feature is a very nice way to navigate around in the files in a project. There is a jEdit plugin named RecentBufferSwitcher that is almost as good. I map it to the same key combination and or to control-t on Lunix and it works well. The plugin can be loaded from the Plugin Manager.
Now we will focus on editing Ruby in jEdit. With the Plugin Manager install the Ruby Plugin. This plugin’s “features include method completion for system types and Rails classes, integrated Ruby docs, syntax error highlighting, auto indent and insert end, structure browser, file structure popup, navigation shortcuts, and progressive selection.” (From the Ruby Plugin documentation.)
The Ruby plugin also requires the plugin SideKick. If it doesn’t not install automatically as a dedendency then install it manually. You also should configure a keystroke shortcut.
Ah, the grand finale. The SuperAbbrevs plugin is what seems to be doing all the magic. This plugin is what performs all the snippet work that people really like about TextMate. As someone who uses both TM and jEdit I will say that TM is better overall and a must have. But, if I need to work on Windows or Linux (God forbid!) I would use this setup and be mostly happy.
I am using the beta version of SuperAbbrevs (v0.21) from here . Once you install it run the menu item “Plugins->Plugin Options->SuperAbbrevs->Abbreviations” and press the button “Import normal abbrevs”. This is important as there won’t be any abbreviations until you do this.
Abbrevs for Rails
The final step is to download some abbreviations for Rails from here. (UPDATE: Here is the zip file jEdit Snippets for Rails.) Unzip the downloaded .zip file and place the files “rhtml” and “ruby” into your .jedit/SuperAbbrevs/ directory.
Once you have all this installed then read the documentation for all these plugins from the help window.