Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to access zen abbreviations using tab completions #50

Open
onecrayon opened this issue Sep 14, 2009 · 4 comments
Open

Find a way to access zen abbreviations using tab completions #50

onecrayon opened this issue Sep 14, 2009 · 4 comments

Comments

@onecrayon
Copy link
Owner

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/

@ttscoff
Copy link

ttscoff commented Sep 14, 2009

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…

@onecrayon
Copy link
Owner Author

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.

@3zzy
Copy link

3zzy commented Sep 19, 2009

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!

@onecrayon
Copy link
Owner Author

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:

  1. Enable custom user actions in Actions->TEA->Preferences

  2. 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>&lt;$SELECTED_TEXT>$1&lt;/$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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants