Open onecrayon opened 15 years ago
Don't know if it helps, but the way the TextMate bundle for Zen Coding is set up, I can have whatever I want as a trailing tab trigger and it's ignored when the line is processed. I'm just using a comma (,) as the trigger now, so I end a zen coding string with a comma and hit tab…
Thanks, I'll take a look at the Textmate implementation! Having a comma-tab (or similar) tab completion that then parses the word before the comma is an interesting idea.
Checking to see if there's any progress on this functionality? I've been using zen-coding tab-triggers on Textmate for months now but miss the auto-complete. My demo will expire shortly, would love to see this working ASAP. Many thanks!
Unfortunately, I'm not going to be able to get this done in the next few days. If you'd like to try the comma-delimited tab trigger, though, here's how to set it up:
Create this XML file:
~/Library/Application Support/Espresso/Support/TextActions/Actions.xml
With these contents:
<?xml version="1.0"?>
<action-recipes>
<action id="com.onecrayon.TextActions.ExpandTabTrigger" category="actions.text.HTML/tea.insertion">
<class>TEAforEspresso</class>
<title>Expand Tab Trigger</title>
<text-trigger>,</text-trigger>
<setup>
<action>word_to_snippet</action>
<options>
<dict>
<key>default</key>
<string><$SELECTED_TEXT>$1</$WORD>$0</string>
<key>extra_characters</key>
<string>_-#.>+*:$!@</string>
<key>mode</key>
<string>zen</string>
<key>undo_name</key>
<string>Expand Tab Trigger</string>
</dict>
</options>
</setup>
</action>
</action-recipes>
Relaunch Espresso twice and you'll be able to type any zen coding snippet followed by comma+tab and it'll expand just like if you'd hit control-comma.
I'd still like to get zen-coding's abbreviations as full tab-triggers (no comma needed), so I'll let you know if/when that makes it into the main TEA plugin.
Will likely need a script to parse the zen dictionary and output action XML for each abbreviation to be run as part of setup.py.
Need to look into whether I can access previous word as part of a tab trigger.
Original discussion thread: http://wiki.macrabbit.com/forums/viewreply/2901/