Text Editor Actions for Coda

I am no longer maintaining TEA for Coda (here’s why) and the download at right only works with Coda 1. If you are interested in future updates or for a version that works in Coda 2, please check out Serge Che’s fork of the project which he is maintaining as part of the zen coding package of plugins. If you would like to build other awesome Coda plugins with Python similar to TEA, take a gander at Justin Hileman’s Coda Plugin.

If you are interested in my recent work, you will need to download Espresso; the vast majority of my code recently has gone into making Espresso even more awesome.


Text Editor Actions for Coda (formerly “Textmate Emulation Actions”, and always TEA for short) is a plugin that emulates some of my favorite Textmate HTML.bundle actions.

If you would like, you can still download the old Applescript version.

Installation

To install, unzip the folder and double click the plugin. You may need to relaunch Coda afterward if you are upgrading.

If you have previously installed the zen coding plugin for Coda, you can uninstall it if you wish; TEA for Coda has zen coding bundled with it, so there’s no need to install both.

See the included README file for installation instructions for the Applescript version if you’re kicking it old school.

Documentation

Most of the actions included are named similarly to the Textmate actions they are imitating and should behave almost identically (except for using Textmate-style tab stops and mirrored snippets, of course).

General → Indent New Line (control-shift-enter)
Moves cursor or selected text to a new line and adds one level of indentation. For example this (pipe represents cursor):

<div>|</div>

Will be turned into this:

<div>
    |
</div>

General → Trim Line(s)
Trim Line(s) will, when invoked, either trim all of the lines in your selection or the current line the cursor is on (if no selection exists). Unlike some trim lines actions, TEA’s Trim Line(s) attempts to be smart about what whitespace it removes:

  • All whitespace at the end of the line will be stripped
  • Any whitespace at the beginning of the line that isn’t part of the indentation will be stripped

What the latter means is that if in the Coda preferences you have the program set to use spaces instead of tabs with four spaces per tab, and the beginning of a line has ten spaces, two of the spaces will be stripped. The action typically handles mixed spaces and tabs intelligently, as well.

HTML → Format: Emphasize (control-option-I) and
HTML → Format: Strong (control-option-B)
These wrap the selected text in an <em> or <strong> tag, respectively.

HTML → Insert Linebreak (control-enter)
Inserts a <br /> element at the cursor, or at the end of the current selection.

HTML → Update <img> Size (command-shift-I)
Use this action when your cursor is inside an <img> tag. It will search the path for the project to try and locate the actual image file and update the tag’s height and width attributes appropriately.

HTML → Wrap Selected Lines In Tag (command-control-shift-W)
As you might expect, this wraps each selected line with a user-configurable tag. If you wish, you can zen coding shorthand to add IDs and classes, include extra attributes, or mix and match:

div#stuff.booyah style="width: 300px;"

Will lead to:

<div id="stuff" class="booyah" style="width: 300px;"></div>

HTML → Wrap Selection In Link (control-shift-L)
This wraps the selected text in a link tag with user-configurable href contents that default to the clipboard contents.

HTML → Wrap Selection In Tag (control-shift-W)
This action wraps the selected text in a user-configurable tag. Just like Wrap Each Selected Line In Tag, it allows zen coding shorthand for IDs and classes along with other tag attributes.

Select → Balanced Tag (control-B)
Selects the tag contents that wraps the cursor, moving outward. This action will work in any syntax, as long as there are HTML tags present (for instance, it will work with HTML that’s interspersed with PHP).

Select → Balanced Tag (Inward) (control-shift-B)
Identical to Balanced Tag, except that it moves inward (so selects the first child of the current tag).

Select → Line (control-L)
Selects the current line (including leading whitespace).

Select → Line Contents (control-option-L)
Selects the line contents (excluding leading and trailing whitespace).

Select → Word (control-W)
Selects the current word under the cursor.

Zen → Expand Abbreviation (control-,)
Runs zen coding on the current word. This action is identical to the TEA for Espresso version.

Zen → Wrap With Abbreviation (control-shift-A)
Wraps the selection or selected lines in a zen coding abbreviation. This is also identical to the TEA for Espresso variant.

I hope you enjoy TEA for Coda!

Clicky Web Analytics