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)

Utilizing tabs (Must know)

This task is a run-through of the various ways to navigate tabs, mostly via keyboard shortcuts.

Getting ready

Open or create a new project with multiple files. Clicking on any of the files in the Project Drawer will open those files in new tabs.

How to do it...

  • Navigate to Next File Tab: From the menu, select Navigation | Next File Tab (Command + } or Command + Option + right arrow)

  • Navigate to Previous Tab: From the menu, select Navigation | Previous Tab (Command + { or Command + Option + left arrow)

  • Go to Tab: From the menu, select Navigation | Go to Tab (or Command + 1 through Command + 9, with the tabs ordered from left to right)

How it works...

Navigating through the tabs with the keyboard shortcuts will speed up your editing time. Once you learn these shortcuts, you can quickly go back and forth between two (or three, or four, or more) files you need to reference or edit.

There's more...

Organizing your tabs is important for an efficient workflow. This includes moving tabs around, closing tabs, and viewing the overflow of opened tabs.

Moving tabs

You can move between tabs very easily by clicking and holding the mouse cursor on the tab and dragging it to a new location.

Closing tabs

Closing tabs is as easy as clicking the X on the tab or using the keyboard shortcut Command + W. You can also use the File menu; select File | Close Tab.

Showing other open tabs

When you have more tabs open than the document window can show, you'll notice some double-right arrows. Clicking on these will drop down a menu with the rest of the open tabs, as shown in the following screenshot:

If you navigate through the tabs using Next File Tab (Command + } or Command + Option + right arrow) and Previous Tab (Command + { or Command + Option + left arrow), you will navigate to the unseen tabs as well.