Rikki has been chipping away at me for months now about a relatively new OS X text editor called “TextMate“.
I’m a long time BBEdit user. I’ve used it ever since version 5 and I’ve never coded anything in any other text editor - so it was always going to be an uphill struggle to get me to switch. BBEdit is comfortable and feels totally natural. I don’t have to think about the interface, my mouse finds its own way around.
Rikki was selling me on many of TextMate’s features, including the “snippets” editor. This allows you to define “snippets” of text that are activated either via a hot key or via a keyword followed by a tab. TextMate comes with hundreds of pre-defined snippets, many for PHP. Not only can you define snippets of text, you can also use TextMate’s tagging system to allow you to tab through the result to change data.
For example:
You type: “array” then hit tab. It adds “$arrayName = array( ‘var’, );” to the document with ‘arrayName’ highlighted. You type in your desired variable name, hit tab and it moves to “var”, change that and hit tab and it moves to the comma, allowing you to delete it or to add more elements to the array.
I finally got around to trying out TextMate today and I’m sold. I’ve purchased a license and retired BBEdit. There are so many time-saving features: from the project display which allows you to list all your project files as a drawer (a common feature to IDEs but lacking in BBEdit) to being able to create your own snippets (I have created one where you type “ips” and hit tab and it adds “$this->ipsclass->” into the document and a few for comments, functions, etc). You can also create commands which can run bash / perl scripts. I have one that takes the highlighted text and runs it as a query on my test IP.D database.
It’s also very, very quick unlike most IDEs I’ve tried. There is no lag when typing and apart from a few seconds for the syntax colouring to kick in when loading a new document (you are free to edit and move around the document while it thinks about the colours, it doesn’t lock up the computer) everthing is instant.
I took a quick movie capture of it in use. Notice how the mouse doesn’t move until I double click on ‘require’ to show off the “Get Document for Word” feature (I set that to F3). The function block illustrates the ability to tab through the snippet elements. Sorry about the dodgy quality and the dark gray banding across the first fifth of the window.
If you’ve got OS X, go buy it now. If you’ve not got OS X, buy a Mac first. It’s almost a killer app.
TextMate.mov ( 2.5mb Quicktime .mov(ie) )
46 comments
Comments feed for this article
November 25, 2005 at 4:07 pm
Rikki
It took me a while, but I got there in the end
It really does speed up coding, and allows you to do pretty much whatever you want in your code. You can write commands to do anything using any language that you can access via Shell. You can launch apps using shell commands. You can run text from any document through PHP using shell. You can even run applescript through shell to do whatever you need.
Right now I can type a query in any document I have open, select it, hit F4 and it pops up a window with the results of the query. You can do all your SVN checking in and out and updates via hotkeys. It’s so customizable it’s untrue.
(Can you see what Matt’s had to put up with for the past couple of months now?)
November 25, 2005 at 4:12 pm
Matt
Seriously.
Rikki is like the TextMate cheerleader.
November 25, 2005 at 4:19 pm
Rikki
2, 4, Text, Mate, who do we appreciate?!
November 25, 2005 at 4:22 pm
Tim Dorr
Cool, I’ve been trying out TM for a little while too. I still switch between it and BBEdit from time-to-time, but I’m starting to like TM more. What you need to do is start using expandable snippets for your comments. I noticed in your video you had to separately type in your comments. Well, try popping in this snippet:
//-${1/(.)|(?m:\n.*)/(?1:-)/g}
// ${1:${TM_SELECTED_TEXT:Comment}}
//-${1/(.)|(?m:\n.*)/(?1:-)/g}
I linked that to “com” and tab under the Source group in the snippet editor. So, I type com, hit tab, and type in my comment. The top and bottom dash lines will automatically expand to fit the text I type. It’s cool stuff.
November 25, 2005 at 4:36 pm
Matt
Now that is cool.
November 25, 2005 at 4:41 pm
Matt
I have it set up so it kind of looks like BBEdit when editing, which gives me warm fuzzies.
http://blog.mattmecham.com/blogimages/textmate.jpg
November 25, 2005 at 5:24 pm
Tim Dorr
Oh yeah, another little useful thing is TmCodeBrowser: http://www.cocoabits.com/TmCodeBrowser/
November 25, 2005 at 6:13 pm
Rikki
It’s not a great acheivement particularly, but it’s useful - I’ve got phpMyAdmin to open in a TextMate window so that it’s really easy to manage the database while coding. The command to add is:
exit_show_html “”
November 25, 2005 at 6:14 pm
Rikki
OK that didn’t work too well. Another try:
exit_show_html “”
November 25, 2005 at 6:32 pm
Rikki
Ah screw it :p
November 25, 2005 at 7:36 pm
Matt
HTML stripping is a pain. :/
November 25, 2005 at 8:33 pm
Tim Dorr
Regular strippers are quite fun, though
November 25, 2005 at 8:35 pm
phatmonkey
Wowee, very nice. I’ll try it out now!
November 26, 2005 at 2:22 pm
Michael
*Cries*
I’m been having a really hard time finding a suitable editor for Windows. I’d switch to a Mac, weren’t it for the fact that I have no cash.
November 26, 2005 at 4:56 pm
Peter
Same here Michael :p
I currently use Notepad2, all the other editors suck, they come bloated with 100’s of features that you will most likely never use.
November 26, 2005 at 11:29 pm
Don Wilson
Michael, for Windows, I think Crimson Editor is the best as it’s light weight, has a great coloring agent and allows for projects.
November 27, 2005 at 2:08 am
Bob
I might give textmate a try on my mac, i just don’t like bbedit.
For windows, i use editplus. It’s not got any of the fancy features of auto complete though, but the colour highlighting works well and it’s really easy to use.
November 27, 2005 at 9:35 am
Kennedy
Editplus is really good.
November 27, 2005 at 8:28 pm
David
I thinking about getting a Mac when I go to colledge, maybe I’ll try out that program. For now I’m good with Dreamweaver 8. Sounds cool, nice cheerleading Rikki.
November 28, 2005 at 1:57 am
rollercoaster375
Code folding? I’m sold. But I must say, SubEthaEdit deserves a mention on OS X. *Runs off to download TextMate*
November 29, 2005 at 9:57 am
Sam Granger
I have just found a coder that can make an application for me identical to TextMate, but for windows.
November 29, 2005 at 7:05 pm
Matt
Really? That’s quite impressive.
TextMate leans heavily on OS X’s UNIX underpinnings to run bash scripts, etc. It’ll be very clever to emulate that on a Win set up.
November 29, 2005 at 7:13 pm
Rikki
Not to mention the fact I’m sure there will be patent issues, since a lot of TextMate is innovative and I’m sure protected…
I like the idea that you can just find someone that’s going to write you what is a very complex application just like that o_O
November 30, 2005 at 2:32 am
Josh
Which features would you say are innovative? From what I’ve read and seen of TextMate, it dosn’t have anything that a lot of other editors have. Although I would have to say that is implemented those features in very slick ways, better than a lot of other implementations I’ve seen.
November 30, 2005 at 5:28 am
Don Wilson
I wouldn’t see how the app has innovative features. The only thing that it could have that is unique is the drawer and the array->tab->[automatic]phpcode, but that seriously couldn’t be that hard to impliment.
If someone made a TextMate for Windows I would definately buy it, but not for the Mac; at least, not yet. From what I’ve seen, it wouldn’t be too hard at all to make an editor like that, depending on your knowledge of any given language.
November 30, 2005 at 5:39 am
Don Wilson
If someone made a TextMate-like app for Windows I would definately buy it, or at least donate money to help out the cause.
November 30, 2005 at 11:34 am
Sam Granger
Well, I have just told the guy he’s hired. Just waiting for his reply.
November 30, 2005 at 7:45 pm
Don Wilson
How much is he asking for that project, if you don’t mind. Also, in what language?
December 1, 2005 at 2:25 pm
Sam Granger
Only $100. Using Visual C++ and MFC.
December 1, 2005 at 3:26 pm
Rikki
I guesstimate that’s about 5c an hour then o_O
December 1, 2005 at 8:01 pm
Sam Granger
Well, very cheap yes. 3rd world country.
December 1, 2005 at 8:51 pm
Don Wilson
I’m already starting to lose interest. >_<
December 1, 2005 at 9:20 pm
TheBrain0110
I use [URL=http://www.blumentals.net/webuilder]WeBuilder[URL]. Does everything I need it to.
December 2, 2005 at 1:11 am
TheBrain0110
Ooops. I don’t suppose you can edit a comment can you?
December 2, 2005 at 3:41 am
Don Wilson
We’re all smart here - we know how to extra a url from bbcode
December 2, 2005 at 11:39 pm
Paul
Wow, I must say this looks like an awesome peice of software. Its just a shame I dont have a Mac.
December 3, 2005 at 9:34 am
Dan
Wow - This is incredible…
I -love- snippets. Being able to add: IPB simple_construct queries with a hit of a tab is awesome.
Rikki - Do you use svnX? If so - how did you set up the repos-update on hotkey thing?
December 3, 2005 at 9:41 am
Dan
Doh! Nevermind - It’s built in. Even better!
December 3, 2005 at 8:22 pm
Rob
Agreed on TextMate. I bought a Mac Mini to play around with OS X. I had no idea TM existed before I bought it. I found it my second day of using OS X, and I paid for the license on the third day. Now it’s the only thing I develop on, I love it.
December 4, 2005 at 6:18 am
Don Wilson
After using TextMate to develop some HTML templates it’s fantastic. I really love the snippets and can’t wait to try it out with some actual PHP usage.
December 14, 2005 at 10:12 am
Danny
Grr damn it, you guys just made me want OS X that much more. I’m getting a mini soon, with soon beeing around 2-3 weeks.
I’ll give it a try. 
February 3, 2006 at 5:55 pm
Ken Liu
TextMate is certainly great, but surely there are more exciting features than snippets - Java IDEs have had this sort of things for 3 or 4 years now. If you want to see the state of the art in IDEs, check out IntelliJ IDEA. Unfortunately it doesn’t do PHP…
Surprisingly, PHP is really lacking as far as IDEs go despite its popularity.
February 10, 2006 at 10:00 pm
alyssa
hey wats up every1
February 10, 2006 at 10:00 pm
alyssa
hey wats up every1
February 11, 2006 at 10:15 am
Andrea
What about eclipse.org and phpeclipse plugin? It’s free, open source. Few hours to install but I’m sure the best choice for every programmer. Very customizable, a lot of plugins.
December 18, 2006 at 4:43 am
Chris
I love TextMate. One of the best features, that no one has seemed to mention, is the validation. It has increbile validation tools. The XML validation is a godsend. I am surprised how well it works with newer languages like XHTML and XML.