C.4. BBEditBBEdit is a popular commercial text editor for Apple computers, considered by many Mac developers to be the best available. You can read about its extensive features, download a demonstration copy of the application, or purchase a full license for the software from http://www.barebones.com/products/bbedit/. To configure BBEdit with the extra editor features suggested in this book, you might first need to create some local folders (in order to pre-empt the application's default support folder). See the application's user manual for more information. Then, adjust your preferences settings. In the Preferences > Editor Defaults screen:
Adjust your tab stops to four spaces. For BBEdit 7, use the configuration panel under Text You can create stationery for any boilerplate file templates you wish to be able to load by using BBEdit to create a file containing the desired code. When the code template is ready, select File To use an abbreviation in BBEdit, you need to install a Glossary item. First, create the folder ~/Library/Application Support/BBEdit Support/Glossary/Perl.pl/. Then, add a file named debug, with the following contents:
use Data::Dumper qw( Dumper );
warn Dumper [ #SELECT##INSERTION# ]; The Glossary will now contain a debug item whenever a Perl file is opened. Selecting that item will wrap the specified text around the current selection, which will be inserted in place of the #SELECT# marker. The insertion point will then be placed wherever the #INSERTION# marker was, and the marker will be removed. You can create as many glossary entries as you wish. For example, a ~/Library/Application Support/BBEdit Support/Glossary/Perl.pl/benchmark file might contain:
use Benchmark qw( cmpthese );
cmpthese -10, {
#INSERTION#
}; ![]() |