Jan
2010
A little less than a year ago I made the switch to OS X and treated myself to a Macbook Pro. Just recently, I started working with the TextMate IDE on a current contract.
My first impression was less than stellar. Visually, TextMate is pretty spartan. Applications on OS X are supposed to be pretty (see Coda). TextMate is most decidedly not pretty. But as I'm starting to learn, she's got an amazing personality.
Sometimes it's the little things that hook you in. For the longest time, I put off learning jQuery. Didn't see the need. I'm pretty comfortable with JavaScript, and couldn't justify investing the time to learn a new way to write what I already knew how to write. Then I learned about .toggle(). I was sold. I hopped into bed with jQuery and I've not looked back.
Today, I was introduced to TextMate's equivalent of .toggle(). It may seem trivial, but it got me hooked, and hungry to learn more.
The hook, in this case, was code commenting. I am used to ⌘+SHIFT+M in CFEclipse, which adds a CFML comment around the currently highlighted code. With TextMate, I hadn't bothered to RTFM. I was using it more as a version of TextEdit/Notepad on steroids than a true IDE, just typing without utilizing any of the shortcuts it provides. But today I asked a co-worker if he knew offhand how to add a comment in TextMate, and he showed me the keystroke ⌘ + / (command slash).
I'll admit that doesn't sound like enough to hook anybody... but what I noticed was that he demonstrated the keystroke on a cfscript block, and I was trying it on a CFML block. And in both cases, the same keystroke inserted the proper comment syntax. On the CFML block, I got <!--- --->. On the cfscript block, he got //. Based on the context of the line of code, the IDE knew which type of comment to insert.
OK. Now I was paying attention.
I opened up an .XML document, hit the same keystroke, and got a proper XML style comment (<!-- -->). Again, the IDE was intelligent enough to know based on the file type, which type of comment to insert. That's the point at which I was hooked. If you're like me (and you wouldn't admit it if you are), you've made the mistake more than once of using a CFML type comment in an .XML file, only to have your application blow up at runtime. With TextMate... no more. Remember the single keystroke, and know that regardless of the file type, or whether or not you're commenting CFML or cfscript, you're going to get the proper comment inserted.
A picture's worth a thousand words. Because you're all very special to me, I've done you one better. Have a look at the video below:
EDIT: Unless you've got -really- good eyes, you probably don't want to watch the embedded version :)


Comments
Add Comment | Subscribe to Comments
-
-
-
-
-
-
-
-
-
-
-
Add Comment# Posted Grant Copley on 1/31/10 1:55 AM
Good post and the video was helpful. I really wish that a program like this was available for Windows. I have tried and purchased the E text editor (http://www.e-texteditor.com/) which is suppose to be "Textmate for Windows" but I found it didn't live up to my expectations, so now I'm back to using Eclipse.
# Posted Tarekac on 1/31/10 5:38 AM
Have you tried CMD+SHIFT+C in cfeclipse? Does the same thing
# Posted Charlie Griefer on 1/31/10 12:23 PM
@Tarekac: Nope, I wasn't aware of that command in CFEclipse. All I knew was CMD+SHIFT+M for a standard CFML comment. Very cool.
I don't have a CFEclipse install at the moment (just a CFBuilder Beta)... but what happens in an XML document? A CSS document?
What I liked a lot about the shortcut in TextMate is that it's consistent between different types of files. That doesn't seem to be the case with Eclipse.
# Posted Charlie Griefer on 1/31/10 12:40 PM
@Grant - I'd never heard of the E text editor. Upon reading your comment that it's supposed to be "Textmate for Windows", that didn't sound right. TextMate integrates tightly with the *nix shell on OS X, so a Windows version didn't sound feasible.
In looking at their site, I see that they use cygwin, so yes, that does make sense. I perused the site a bit, and was pretty impressed. It really does sound like as close of a true port of TextMate to Windows as possible. Too bad it didn't meet your expectations.
FWIW, I used Eclipse (and CFEclipse) for the last 4+ years. I donated to CFE back when Mark was leading the project. I don't think there's anything "wrong" with being "back to using Eclipse". For now, at least, I'm just finding that I like TextMate a little bit better. That doesn't make Eclipse (or CFE) bad :)
# Posted Charlie Griefer on 1/31/10 12:45 PM
BTW, while responding to @Tarekac, I did a quick Google to verify the keystroke (didn't have a CFEclipse install handy to test). Came across this blog entry by Simon Whatley: http://www.simonwhatley.co.uk/cfeclipse-keyboard-s...
Very handy for CFEclipse users.
# Posted Aaron West on 2/4/10 10:06 PM
Charlie, thank you for posting this entry. I've been thinking about tryin out other OS X text editors recently. I use TextExit pretty heavily and Text Wrangler quite frequently until recently. I glanced at the TextMate site and moved on thinking it sounded too much like Text Wrangler which is free. I'm not necessarily looking for a new code editor, but after reading your post I'm going to try Text Mate. While I'm at it, would you mind posting your favorite plugins? I've heard there are some good ones but I have no experience with any yet. Thanks!
# Posted Charlie Griefer on 2/4/10 10:26 PM
@Aaron - I know what you mean about first glances. I've had my MBP for close to a year now, and up until now thought that TextMate was to TextEdit like WordPad is to Notepad in Windows.
Basically, never thought of it as an IDE, but more of a robust text editor.
As far as bundles go, I can't offer up any recommendations yet. I've really only been using TextMate as an IDE for about 3 weeks now... I'm still learning basic functionality (but really liking what I've been learning).
I'll be happy to post a followup entry with a list of bundles in the very near future.
# Posted Aaron West on 2/5/10 9:22 AM
That'd be great Charlie. Being a complete TextMate noob (just downloaded it) I'd appreciate anything that gets me up to speed quickly.
# Posted Ryan Jeffords on 2/15/10 10:17 AM
I've been dying to kick CFBuilder to the curb for months now. I use TextMate as my standard text editor and love the CF bundle. My biggest pet peeve is the lack of native FTP/SSH support along with the FORCING of "projects". Whatever happened to just having a file browser and letting you open/edit/save your files on demand? Why do you HAVE to use "projects"?!
Anywho, I look forward to any other feedback you may have on TextMate. I'm desperate to switch over!
# Posted Jose Galdamez on 3/14/10 7:58 AM
I've been considering trying out TextMate for a while now just cause I want something both lightweight and powerful. I tried CFB since its first beta, and while I really wanted to love it the performance issues killed it for me.
Since learning about the zen-coding plug-in, I've been determined to stick to an editor that supports both it and CFML code coloring, code hinting, etc. For the time being I am going with Eclipse/CFEclipse. At some point I will move over to either Coda or TextMate. Both are pretty powerful. TextMate even has an entire book devoted to it, which I may just check out.
To see zen-coding go here
http://code.google.com/p/zen-coding/
# Posted Ryan Jeffords on 3/19/10 8:51 AM
Since my last comment I've completely committed myself to Coda. I enjoyed CFBuilder, but it just wasn't for me. Coda does everything I need it to do and is light weight, beautiful, and extremely powerful.