Rubénerd Blog :)

Sunday 01st November 2009

TextMate defaulting to the root directory

I’ve started using TextMate more on my Macs for editing code because It Just Works™ and has some really useful features. It just has one nagging little problem to do with files; every single time I create a file outside a project and go to save it, the Save As dialog box ignores where other open files are located and defaults to the root of my primary hard drive to save the file. Every. Single. Time!

I don’t want to have to create projects for each set of files that I’m working on once and forgetting about, is there any way to modify this default behavior? Even having it default to my home directory would be a start.

Sunday 27th May 2007

Using Smultron and TextMate

Smultron is an open source text editor for Mac OS X written by Peter Borg, and I must say I’m impressed with it. Simple code editing on individual files is a snap, and the sidebar is much more elegant than an entire row of confusing tabs.

I’m currently a TextMate on my MacBook Pro user mainly because of convenience. For one thing the projects are easy to set up and are in XML (which I’ve been told I have a borderline perverse obsession with), and from one Bundles menu I can select the language I’m coding in and I have all the actions and properties I need. Smultron does have Project like functionality, and it does have a code colouring menu which actually supports far more syntax rules than TextMate, but it doesn’t have the other functionality for individual languages.

I don’t think it’s fair though to compare TextMate and Smultron head on, because I use them for different things. Editing individual text files which have little in common with each other is obviously easier in Smultron because of TextMate’s maddening lack of tab support for files that aren’t a part of the same project, but TextMate is more useful for managing entire projects, such as Ruby on Rails site or a graphical Java Swing programme. If you’ve used Mac OS X for a while, I like to think of TextMate as a replacement for Xcode, and Smultron as a replacement for TextEdit. Sort of.

From a polish point of view, TextMate’s icons are certainly much slicker than Smultron’s default ones, though Gaetan Ark has released the original icons for Smultron he designed as a separate file you can use to patch your Smultron.app file.

Like a true open source gentleman Peter doesn’t ask outright for money, but he does have a donation page if you find his program useful. When I get my POSB MasterCard thingy I’ll definably put some bread in the jar. Even though I’m not a Piano Man.

Some basic screenshots of some crappy Ruby and Perl scripts I whipped up to demonstrate the syntax support. Ignore the date, as of May I’m still typing 2006 on everything.

Ruby in Smultron

Perl in Smultron

As for my FreeBSD machine though, nothing beats Kate!

Dedicated to my groovy late mum Debra Schade.