View Review Details


Book:   TextMate
Subject:   The Power of Textmate
Date:   2007-05-25 12:42:27
From:   Dave Walz-Burkett
Rating:  StarStarStarStarStar

This book is the perfect primer for what I have found to be one of the most indispensible Mac OS X applications - TextMate. If you are a software developer or web designer or anyone else that edits text on a frequent basis and you have not already discovered TextMate, stop right now and visit http://www.macromates.com.


The Pragmatic Programmers' book, TextMate Power Editing for the Mac is a thorough introduction to TextMate. James Edward Gray II has written a very accessible book, that covers the product very well.


The first third of the book is devoted to the basics - things you do every day in your text editor. The second third of the book dives into the details of some really sweet features of TextMate that you'll find yourself using all the time: bundles, snippets, macros and UNIX shell commands.


TextMate ships with over thirty 'bundles'. Each bundle is a directory of related files that provide additional functionality to TextMate. Let's say you're working on an HTML file. The HTML bundle will help you with loads of things related to your document: validate the syntax of the document, open the document in the default browser, refresh the document in the current browser session, insert open/close tags for the current word, strip all HTML tags from the document - just to name a few. Each bundle provides functionality that applies not only to the syntax of the language you're currently working with, but repetitive tasks that would apply as well.


As I mentioned, a couple dozen bundles ship with TextMate and many more are available for free download from various websites. You can even create your own bundles to extend the product in ways that only you can imagine. Here are a few of the bundles that ship with TextMate: Blogging, CSS, HTML, Java, Markdown, Objective-C, Python, Rails, Ruby, SQL, Subversion, Text, Textile, Xcode and XML. Bundles provide you with lots of help editing files and performing related tasks.


Snippets are a smart completion mechanism that go way beyond the simple concept of 'finish this word'. For example, if you are editing a Ruby file and you type array_object.ea followed by the TAB key (where 'array_object' is an arbitrary Array object), the snippet feature will automatically fill in the skeleton of the 'each' iterator, including the opening and closing curly braces, the text '|e|' with the letter 'e' highlighted. You simply type the name of the variable you want to represent the next element (or simply leave it as it is), hit the TAB key again and the cursor will be placed between the closing '|' character and the closing '}' character, ready for you to type in an expression. Very cool. This same trick works for dozens of different scenarios in your Ruby code. And that's just the snippets that apply to Ruby code. There are snippets that apply to a large number of file types.


You've probably seen macros in other editors and TextMate's macro facility works as you might expect: you start recording a macro, perform some actions and save the macro. TextMate saves the macros as XML files, so it's a snap to edit a macro after recording if you need to tweak it a bit.


The ability to fire off UNIX shell commands from within TextMate gives you another powerful tool to use while editing files. You can fire off one-liner shell commands by simply pressing the ^R key on a line containing a shell command. You can also use shell commands to act on all or part of the current document.


For the advanced TextMate user, the tail end of the book shows you how to create your own language syntax for use in TextMate, including how to describe the grammar of the language in terms TextMate will understand. So, if you program in some far out funky language that TextMate doesn't support out of the box, you can add the language grammar to TextMate and program away!


Overall, I found this book extremely useful and easy to read. TextMate ships with an excellent help system that will answer many of your questions. The TextMate Power Editing for the Mac book will take you beyond the built-in help and give you an in-depth guide for this great Mac application.


TextMate
See larger cover