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)

Converting text (Must know)

This task will demonstrate how to convert text in various ways.

How to do it...

TextMate provides the following text conversions:

  • Uppercase: This will convert the entire selected text to uppercase letters. From the menu, select Text | Convert | to Uppercase (Control + U).

  • Lowercase: This will convert the entire selected text to lowercase letters. From the menu, select Text | Convert | to Lowercase (Control + Shift + U).

  • Title case: This will convert the first letter of each word in the selection to uppercase. From the menu, select Text | Convert | to Title case (Option + Control + U).

  • Opposite case: This will swap the case of each letter of the selection (for example, lowercase will become uppercase and uppercase will become lowercase). From the menu, select Text | Convert | to Opposite case (Control + G).

  • Spaces to Tabs: This will convert spaces to tabs (as defined in Tab Size). From the menu, select Text | Convert | Spaces to Tabs.

  • Tabs to Spaces: This will convert tabs to spaces (as defined in Tab Size). From the menu, select Text | Convert | Tabs to Spaces.

  • Transpose: This will output the selection backwards. From the menu, select Text | Convert | Transpose (Control + T).

How it works...

Most of these conversions should be self-explanatory. Some text conversions are shown in the following screenshot:

Tabs to Spaces (or Spaces to Tabs) is helpful if you decide later on to change to or from Soft Tabs. It's also useful if you want to play a practical joke on a colleague who is vehemently against either soft or hard tabs.