ebook img

TextMate: Power Editing for the Mac PDF

198 Pages·2007·2.208 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview TextMate: Power Editing for the Mac

What readers are saying about TextMate: Power Editing for the Mac This is not just a book, but a doorway to higher dimensional text edit- ing! By the thirdchapter I was completely switched over to TextMate fromVim. The book provided everything I needed to take full advan- tage of all that TextMate offers. This book rocks, and James is my new hero. Ernest Obusek SoftwareEngineer, Network Appliance, Inc. This book is outstanding. Without saying it, James has made the case for TextMate quickly becoming the interface for 90% of what any OS X user will ever need to do. I’ve read a substantial amount of material concerning both OS X and TextMate, but by Chapter 3, James had blown me away. By the end of Chapter 5 ...wow. This is some power- ful stuff. Stephen Hargrove System Administrator As an Emacs junkie, it takes considerable persuasion for me to even consider using another editor. This book did the job, and now I use TextMate regularly. The chapters on the various built-in automations, scripting and snippets are invaluable. Ruby on Rails and other coding enthusiasts will also find that this book provides ample coverage of programming oriented tasks. Jon Mountjoy Director, MemeStorm Ltd. I’ve been using TextMate for months and I thought I knew everything it could do. I was surprised to discover many editing tricks and key- commands that I had completely missed. James did a terrific job mak- ing this book an essential asset for even a seasoned TextMate user. Michael Gregoire Owner/Creator, nvzion.com and blocSonic.com TextMate is like an onion. It seems like such a simple thing when you first see it, then you start peeling back layers and suddenly discover the richness that lies underneath. This book peels the onion that is TextMate, revealing the awesome power underneath. It has become my Swiss-army chainsaw, flexible enough for everything and powerful enough for anything. Neal Ford Application Architect, ThoughtWorks A thorough, practical referencefor anyone who ever wondered if there was more to life than Dreamweaver. Benjamin Jackson Technical Director, INCOMUM Design and Concept This beautifully written text brings the power of TextMate to some- one who does not know any programming language. Each page reveals hidden, indispensable tricks that improve work flow, which is what the TextMate philosophy is all about. Jenny Harrison Professor of Mathematics, UC Berkeley TextMate Power Editing for the Mac James Edward Gray II The Pragmatic Bookshelf Raleigh,NorthCarolina Dallas,Texas Many of the designations used by manufacturers and sellers to distinguish their prod- uctsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andThe Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The PragmaticProgrammer,PragmaticProgramming,PragmaticBookshelfandthelinkingg devicearetrademarksofThePragmaticProgrammers,LLC. Every precaution was taken in the preparation of this book. However, the publisher assumesnoresponsibility for errorsor omissions,or for damagesthatmay result from theuseofinformation(includingprogramlistings)containedherein. Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatictitles,pleasevisitusat http://www.pragmaticprogrammer.com Copyright©2007ThePragmaticProgrammersLLC. Allrightsreserved. Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmit- ted, in any form, or by any means, electronic,mechanical,photocopying, recording, or otherwise,withoutthepriorconsentofthepublisher. PrintedintheUnitedStatesofAmerica. ISBN-10:0-9787392-3-X ISBN-13:978-0-9787392-3-2 Printedonacid-freepaperwith85%recycled,30%post-consumercontent. Firstprinting,January,2007 Version:2007-2-23 “Jamesenjoysplayingchess andloveshismotherverymuch.” ForNicoleandPayden,asisterandbrothersocool theymakemelookgood,andthePaynewomen whoremainmybiggestfans. Contents 1 Introduction 12 1.1 A Brief History of TextMate . . . . . . . . . . . . . . . . . 12 1.2 In These Pages . . . . . . . . . . . . . . . . . . . . . . . . 14 1.3 The Mac Keyboard and Mouse . . . . . . . . . . . . . . . 15 1.4 Installing TextMate and Tools . . . . . . . . . . . . . . . 17 1.5 The Editing Window . . . . . . . . . . . . . . . . . . . . . 19 I Editing 21 2 Projects 22 2.1 Creating a Project . . . . . . . . . . . . . . . . . . . . . . 22 2.2 Moving between Files . . . . . . . . . . . . . . . . . . . . 24 2.3 Shortcuts for Creating Projects . . . . . . . . . . . . . . . 25 2.4 Folder References . . . . . . . . . . . . . . . . . . . . . . 26 3 Power Editing 29 3.1 Moving Around . . . . . . . . . . . . . . . . . . . . . . . . 29 3.2 Making Selections . . . . . . . . . . . . . . . . . . . . . . 33 3.3 Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 4 Find and Replace 45 4.1 Without Using a Regular Expression . . . . . . . . . . . 45 4.2 Mixing in Regular Expressions . . . . . . . . . . . . . . . 50 II Automations 58 5 Built-in Automations 59 5.1 The TODO Bundle . . . . . . . . . . . . . . . . . . . . . . 59 5.2 The HTML and CSS Bundles . . . . . . . . . . . . . . . . 62 5.3 The Ruby Bundle . . . . . . . . . . . . . . . . . . . . . . . 65 5.4 The Rails Bundle . . . . . . . . . . . . . . . . . . . . . . . 67 CONTENTS 10 5.5 The Subversion Bundle . . . . . . . . . . . . . . . . . . . 69 5.6 The Math Bundle . . . . . . . . . . . . . . . . . . . . . . . 72 5.7 The Markdown Bundle . . . . . . . . . . . . . . . . . . . 73 5.8 The Blogging Bundle . . . . . . . . . . . . . . . . . . . . . 77 5.9 The Mail Bundle . . . . . . . . . . . . . . . . . . . . . . . 78 5.10 The Text Bundle . . . . . . . . . . . . . . . . . . . . . . . 79 5.11 The Source Bundle . . . . . . . . . . . . . . . . . . . . . . 80 5.12 The TextMate Bundle . . . . . . . . . . . . . . . . . . . . 81 6 Snippets 83 6.1 Basic Snippets . . . . . . . . . . . . . . . . . . . . . . . . 83 6.2 Tab Stops . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7 Macros 97 7.1 The Macro Editor . . . . . . . . . . . . . . . . . . . . . . . 100 8 Commands 103 8.1 Shell Commands . . . . . . . . . . . . . . . . . . . . . . . 103 8.2 TextMate Commands . . . . . . . . . . . . . . . . . . . . 105 8.3 Drag Commands . . . . . . . . . . . . . . . . . . . . . . . 115 9 Automation Tips and Tricks 117 9.1 Building Bundle Menus . . . . . . . . . . . . . . . . . . . 117 9.2 TextMate’s Environment Variables . . . . . . . . . . . . . 119 9.3 Useful Shell Commands . . . . . . . . . . . . . . . . . . . 124 9.4 Using TextMate’s Document Parsing . . . . . . . . . . . 129 9.5 bash Support Functions. . . . . . . . . . . . . . . . . . . 131 9.6 Ruby Support Libraries . . . . . . . . . . . . . . . . . . . 133 9.7 Hooking Into Save Operations . . . . . . . . . . . . . . . 134 9.8 Streaming Command Output . . . . . . . . . . . . . . . . 136 9.9 Building Interactive Commands . . . . . . . . . . . . . . 139 9.10 Compound Automations . . . . . . . . . . . . . . . . . . 142 III Languages 145 10 Language Grammars 146 10.1 The JSON Data Language . . . . . . . . . . . . . . . . . . 146 10.2 Language Grammar Reference . . . . . . . . . . . . . . . 167

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.