Book Image

TextMate How-To

By : Christopher J Mears
Book Image

TextMate How-To

By: 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)

Learning and loving bundles (Must know)


This task will quickly cover the use of bundles, including the beauty of tab completions and how to easily find the bundle item you're looking for along with the tab completion abbreviation or the keyboard shortcut.

How to do it...

  • Tab completion: Type in a tab trigger, for example, div in an HTML document, and press the Tab key. The following screenshot shows how the code is auto-completed:

  • Opening bundle actions: You can open the bundle actions by clicking on the gear icon in the status menu or with the keyboard shortcut Control + Escape.

  • The Select Bundle Item window: This window allows you to quickly find a particular bundle action, whether it's a tab-completed snippet or a keyboard shortcut. You can open the window from the menu by selecting Bundles | Select Bundle Item… or use the keyboard shortcut Command + Control + T. This window is shown in the following screenshot:

How it works...

  • Tab completion is one of many ways in which bundles can help with writing and code development. They are very useful shortcuts that will greatly speed up your coding.

  • Opening bundle actions is just like opening the bundles menu item, but with the benefit of easier access through a simple keyboard shortcut.

  • The Select Bundle Item window is used just like the Go to File... option with projects. You can type in the search bar to quickly filter all of the bundle actions.

There's more...

If you want to dig deeper into learning more about a particular bundle, Bundle Editor is the place to go.

Exploring bundles

You can filter and view many other bundle items, such as commands and macros, in the Bundle Editor (select Bundles | Bundle Editor | Show Bundle Editor or Command + Option + Control + B). If you want to know how a particular bundle item works, find it here. The Bundle Editor window is shown in the following screenshot: