O'Reilly logo

TextMate How-To by Chris Mears

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Folding (Should know)

Folding is a great way to organize your code as well as hide lines in order to focus on the current task at hand.

Getting ready

To use folding, you'll need to make sure it's enabled. You can toggle it by going to View | Gutter | Foldings from the menu.

How to do it...

Folding actually happens automatically as long as you have the proper language selected via the status bar pop-up:

How to do it...

How it works...

As with most of TextMate's functions, learning the keyboard shortcuts for folding is key to working with your document.

Shortcut

Description

F1

Fold current block.

Option + Command + 0

Fold All Levels toggle.

Option + Command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required