Text Editing
Posted by Vince Wadhwani on Jan 26, 2008
When you write code, the text-editor you use makes a big difference in your productivity. Textmate is the biggest thing I miss from using Mac OSX. There have been many attempts and some progress has been made along the way. I went through a few different applications but I think I've finally settled on Gedit. If you're interested in reading why (and where I went to customize my install) then by all means click through.
I should say that I feel so seriously about the text editor that I'd consider an entire Desktop Environment (i.e. Gnome vs KDE) in order to get the right one. Initially I started out with Kate on KDE3. This is a very good text editor but the lack of a tree view really drove me nuts. There is a solution for that but it requires you compile Pate using python 2.5 -- something that will work out of the box on Kubuntu but not currently on Debian which is stuck on Python 2.4.4
Since my experience with Kate was so good I was chomping at the bit to try the version in KDE4 in hopes it might support a tree view. Alas it still does not as of 4.0.0. It may come in the future though so I've got my eye out. Kate in KDE4 does do everything KDE3's version did but better and more beautifully. Code folding is particularly impressive. The Ruby highlighting was great but not perfect and strangely the Ruby/RHTML highlighting seemed to miss more than it got. I'm sure those will be fixed in time, but for the moment KDE4's Kate is not a solution for me.
I also looked at the highly touted Scribes text editor. It is quite good. There were a few things that really bothered me about it though:
- If you accidentally typed a character in your code and closed the document, Scribes would save the document without warning you. Hence you could potentially introduce bugs in your code just because your paws hit the letter q instead of control-q
- It wouldn't display all the documents correctly when opening files. It would default to Text Documents (no way to change that as far as I could find) which would display a few files but not all of them even if the extension was the same. e.g. it would display show.rhtml and edit.rhtml but not new.rhtml until you changed the filter from Text Documents to All Documents. Really annoying..
- It wouldn't remember where you were when opening a file. So if you were in /home/vince/Sites/buyindie/app/controllers and opened foo.rb you'd have to navigate all the way down that path again to open bar.rb.
Scribes devs are dead set against tabs, which I get, but it would be easier to deal with if the above were fixed. Otherwise I find I spend too much of my time navigating and not enough coding.
So like I said, I ended up with gedit. Here's the blog I followed that led me to the various parts needed to cobble together a workable solution. (I did use these instructions for the mime-type instead as they seem more up to date.)The only thing I couldn't solve from his instructions was the fact that the bracket complete wasn't smart enough to know when you were typing to close a bracket or open one. Hence you could end up with " hi """ instead of " hi ". I didn't feel like changing my habits and luckily I don't have to. Enter the Gemini plugin for Gedit by Gary Haran. And with that, I've basically got a decent clone for Textmate on Linux. Textmate, of course, has a bazillion features that Gedit does not, but of those I miss only a handful. Maybe in time those will be here too.
Update April 25, 2008: Read here for a little more tweaking to make gedit even more rails friendly.