Creating Clips
Coda’s Text Editor has a really neat feature, called “Clips,” that allows you to invoke often-used chunks of code or text very easily. Clips can be used a few different ways. This tip will cover how to create a clip, but also will let you know how to use them.
Creating A Clip
When in the Text Editor (⌘+2), click on the “Clips” button at the bottom of the screen. A screen will pop up, showing the Clips that you already have installed. You will notice that you can make global clips, which can be called from any file you edit in Coda, or site-specific clips, which will only be available to files within the site that you’re working on.
Click the plus sign (+) at the bottom left corner of the Clips window. Give your clip a title, such as “Conditional Comment for IE6 and Under.” Then, enter code or text into the large text area in the window. For the above title, the following code would work:
You’ll note that there is an asterisk in my clip. You should replace this with a “selection placeholder,” which you will find available in the bottom left of the New Clip window. This placeholder will allow you to drag the clip onto selected code in the Text Editor, which will magically wrap itself around the selected text.
In the section that says “click here to add tab trigger,” type ‘ltie6′ and hit the tab (TAB) key. Now click save and start working with your new clip!
The tab trigger is one of my favorite features of Coda’s clips, and can really save you a lot of time by typing tedious code for you. To use the one we just set up above, type ‘ltie6′ and hit the tab (TAB) key in the Text Editor window. Your new clip will insert itself into your document. Neat, huh?
Tags: clips, global, placeholder, selection, site, tab trigger