Book Image

TextMate How-To

By : Chris Mears, Christopher J Mears
Book Image

TextMate How-To

By: Chris Mears, Christopher J Mears

Overview of this book

Not all text editors are created equal. TextMate was created with versatility and power to the developer. Whether you want to organize your files in projects, utilize the efficiency of code completion, take advantage of the thousands of publicly available bundles, or gain insight using powerful regular expression searching, TextMate is an essential and easy-to-use tool you need in your development arsenal. "TextMate How-To" is a practical guide filled with conventional recipes on using one of the most popular text editors on the OS X platform. It is a great resource for anyone who wants to learn how to code more efficiently and effectively, no matter what programming or scripting language you use. This book will guide the reader through using TextMate for practical purposes. It will start with configuring the application, then cover navigation and editing of files, and finish with bundles and advanced features. Throughout the book, the reader will quickly master the key features of the application through easy to follow tasks. Using this book, the reader will learn the most common text editing and coding tasks including navigation through the document and searching of text. The reader will then learn about working with and navigating between files and projects as well as utilizing bundles to greatly speed up development. Finally, explore the ability to use shell commands and macros to increase productivity. With just a few hours, "TextMate How-To" will teach the reader everything necessary to hit the ground running with this powerful text editor.
Table of Contents (7 chapters)

Installing themes (Must know)

Though it doesn't do much for the actual usage of the application, themes and code coloring will help with understanding and interpretation of any text or code you'll be dealing with. TextMate comes with a number of themes already installed (accessible via Preferences), but if you can't find one that suits your particular tastes, this task will go through downloading and installing a theme, specifically the popular and freely available RailsCasts theme.

Getting ready

Download the ZIP file at This is shown in the following screenshot:

How to do it...

Once the ZIP file is downloaded, extract it and double-click on the theme files which have the .tmTheme extension to install and switch to the theme. The theme files are shown in the following screenshot:

How it works...

Made famous by Ryan Bates' screencasts (, RailsCasts is a great and aesthetically pleasing theme that can be used for a number of languages, including PHP, Ruby, HTML, and JavaScript.

You will notice that the RailsCasts theme ZIP file contains two versions. The one labeled ryan-light.tmTheme has a white background. The original has a dark background and is also the version used for most of the screenshots in this guide. Whichever you choose to use is purely your preference, but there is no harm in installing and trying both.

You can switch themes by going to File | Preferences (Command + ,) and selecting the Fonts & Colors tab, as shown in the following screenshot:

There's more...

In case the included or RailsCasts theme doesn't adhere to your particular tastes, there are many other popular themes available.

Solarized theme

Another freely available theme is called Solarized, and can be found at The Solarized theme is stated to be specifically useful on calibrated and non-calibrated displays alike, as well as in a variety of lighting conditions. Since the theme consists of a simple color palette, it's easily translatable to terminal emulations and therefore highly versatile between applications.

You can find out more about the Solarized theme, including themes for additional applications, at

More themes!

There are many more themes available on the Macromates wiki: