:: TextMate ExpressionEngine Bundle (April 5, 2006)

Skip to main content
Newer: April 2006 Top 10 Songs Older: 1-2-3-4-5-6

TextMate ExpressionEngine Bundle

Several months ago, I made the switch from BBEdit to TextMate. I haven’t regretted that decision once. In fact, with each new update of TextMate, I become more confident I made the right decision.

I do quite a bit of work that involves ExpressionEngine, which has it’s own markup similar to XHTML. I wanted a way to easily differentiate between regular XHTML and EE markup. Thanks to the flexibility of TextMate, I was able to create a bundle that does just that, plus some.

Example of my EE bundle for TextMateYou can see in the example to the right that all EE tags are highlighted for easy identification. It doesn’t highlight EE tags inside of quoted strings though, but that’s not a big deal.

Another feature you can see in the example is that I’ve included many snippets to make creating new templates much easier. In the example, I’ve typed in “entries” and hit the Tab key. Since there are three snippets that have that trigger, all three are listed and I can choose which one I want. I select the {exp:weblog:entries} tag and it adds in the basic structure that I need to get started. I can quickly tell it what weblog to use, what to disable and any other parameters thanks to how TextMate’s snippets allow for cursor placement. I’ve included over 50 snippets and plan to add some more soon.

Another really cool feature is shown below. You can select an EE tag and hit control-e to open up a small window showing the manual instructions for it. It will work on all standard tags that include “exp:” in them as well as a few others commonly used. It will not work with plugins since there’s no way I could easily keep up with all of them.

One that is set up a little different, and I use a fair amount is the time formatting entry. Instead of selecting the tag name, you select the “format” parameter and it will open up the manual to the time formatting instructions. I can never remember what the different options do, so this comes in quite handy.

Download the TextMate ExpressionEngine bundle.

Example showing the EE manual entry for a selected tag

April 30, 2006 - I’ve taken some time to polish up the bundle now. I’ve redone the entire language file in the bundle which makes for much better highlighting and code folding now. If you’d like to try it out, subscribe to the mailing list and look for a recent thread titled ‘ExpressionEngine bundle’. It’ll be attached to an email in the thread.

April 30, 2006 - I’ve now made it available for download on this site. If you use EE and TextMate, download the bundle and let me know what you think. Submit feature requests here too.

June 22, 2006 - I’ve uploaded a newer version of the bundle. No huge changes with this one, just a little organization in the bundle menu. If you’ve got some tags, templates or other features you’d like to see in the bundle, let me know.

Sept. 7, 2006 - The bundle has been updated to include EE comments, wiki tags, the improved embed tag, the simple commerce purchase tag and a few other additions. If you have anything else you’d like added to the bundle, or you’ve found a mistake, let me know.

June 6, 2007 - I’ve polished up a couple of the existing snippets, and added a few more that were missing. The biggest addition to this version is auto-completion of EE parameters. I believe I’ve got them all included. Let me know if I’ve missed anything.

Oct. 23, 2007 - Just a note to let Windoze users know that my bundle will work with e-Texteditor. You might get a lot of error messages when unzipping the file, but it should still work correctly.

Feb. 11, 2009 - Minor update. I’ve added some more parameters to the auto-completion list, and added the {wiki:categories_list} tag. I also added Dane Thomas’ EE comment preference to the bundle. Now you can easily wrap any code inside of an EE template in an EE comment ().

Carlos's gravatar Carlos Japan April 7, 2006

Did you finish the bundle?

Chris's gravatar Chris United States April 7, 2006

I haven’t had the time yet to finish it, but should this weekend sometime.

Josh's gravatar Josh United States April 18, 2006

Hey, I came across your site will looking thru the featured sites on and I saw this post. Have you finished the bundle yet? I’m gonna have to give textmate a try now. smile

Chris's gravatar Chris United States April 18, 2006

Sorry, Josh. Not yet. There’s just not enough time in the day it seems.

I hope to set aside some time soon to finish it up, as well as my Who’s Talking Pepper for Mint. Both are low priority though since my work load is pretty high right now.

Elwin's gravatar Elwin Netherlands April 26, 2006

Excellent, I’m looking forward to the bundle.

cboone's gravatar cboone United States April 28, 2006

Yeah, an EE bundle would be fantastic.

Maybe you could just release what you’ve got, and the community could help you polish it up?

Chris's gravatar Chris United States April 28, 2006

I’m actually thinking about doing that. I just don’t have the time to go over it. When I’m not working, I just don’t feel like going over code any more.

What’s the best way to get that set up? Submit my bundle to Allan and let him add it to the Subversion repository?

Chris's gravatar Chris United States April 30, 2006

I’ve become motivated to work on the bundle again. I took a look at how the Movable Type bundle was put together and redid their language file to work with EE tags. That means highlighting works like it did before, but there’s also code folding for the major EE tag pairs and conditionals.

If you want to try it out, subscribe to the TextMate mailing list. I recently attached it to an email in the list.

I’m really happy with the bundle now. It could use some more snippets, but I’m not sure what people really use and want. I’ve got most of the major tags in there. If you want some other ones, please let me know what they are.

Chris's gravatar Chris United States April 30, 2006

Just a note to let people know the bundle is available for download from my site now.

TextMate EE bundle

Backspace's gravatar Backspace United States May 1, 2006

Great news! Thanks Chris, for putting in the extra effort to get it finished and out to the community. We certainly appreciate it.

Backspace's gravatar Backspace United States May 1, 2006

Chris, I’ve got the bundle installed but I’m not quite sure how to initiate the code completion in Textmate. I looked in the bundle and it says to use ‘tab’ but typing {exp and hitting tab simpley inserts a tab. What am I missing to show the code completion?

Backspace's gravatar Backspace United States May 1, 2006

Umm… it should’ve said “but typing {exp and hitting tab”, sorry about that.

cboone's gravatar cboone United States May 1, 2006

Awesome. Thanks for putting it out there.

I’ve just downloaded the bundle and am about to test it out as I get to work. Looking forward to it.

Chris's gravatar Chris United States May 1, 2006

Backspace, the tab triggers don’t include exp:. Doing so would mean a list of tags a mile long.

If you open the Bundle Editor window and look inside the EE bundle, you’ll notice that some of the tags have words in paranthesis. That would be their trigger. Most of the other major EE tags use the last word of the tag as their trigger.

For example:
[Tag] -> [Trigger]
exp:weblog:entries -> entries
exp:weblog:categories -> categories

You can also select the snippet and it’ll show you the trigger word, if it has one.

Backspace's gravatar Backspace United States May 1, 2006

Ah, I see now. Thanks for the explanation. smile

Erwin Heiser's gravatar Erwin Heiser Belgium May 29, 2006

Nice one! I hate typing so this is going to come in real handy, finally a reason to purchase textmate smile

Brad's gravatar Brad United States May 31, 2006

I’m a big EE fan, and an even bigger Textmate fan, so this is wonderful!

But just so I’m clear… so would one have to open a template in EE through the CP, copy, paste into Textmate, edit, then copy and paste back into the CP and hit update? Is there anyway to setup EE to read actual files instead of templates being database driven as well? I realize this is part of what makes EE so freaking special and powerful and flexible… but is anyone aware of a way to do this?

Chris's gravatar Chris United States May 31, 2006

Yes, you can set up EE to read files via FTP. Read this.

John's gravatar John United States June 2, 2006

Thanks a lot for this! I was actually looking on the TextMate website last night and noticed EE in the TODO list. I’m glad to see this is actually done! I just purchase my TextMate licese.

Cory's gravatar Cory United States June 3, 2006

Thank you for this bundle, Chris, it’s very nice! Makes me love TextMate even more.

I have a question with the EE reading files through FTP thing: is there a way to have TextMate save the files through FTP? Sorry if this is a dumb question!

Chris's gravatar Chris United States June 3, 2006

I use Transmit as my FTP client. You can set TextMate up to be your default editor. If you also have EE setup to save templates as files, then all you need to do is select the file in Transmit you want to edit and choose “Edit in TextMate” in the contextual menu. It will open up the file in TextMate for you to edit. Once you’re done, just save the file and it will automatically be uploaded to the server.

In my opinion, there is no better way to work with EE templates.

karsten's gravatar karsten Germany June 3, 2006

thxs for this. this was the reason for me to pay textmate

Cory's gravatar Cory United States June 4, 2006

Transmit, ah. I’ll see if I can do this in Cyberduck. Thanks!

Kaoro's gravatar Kaoro United States June 4, 2006

I’m same person as Cory above ^^.

I wanted to ask, EE will only save template files with the .php extension. But in textmate I have to change the syntax-highlighting method from the menu at the bottom of the window every time I edit a .php file containing the css code for my site.

Anyway to fix that?

Chris's gravatar Chris United States June 4, 2006

You should only have to change it once. Are you leaving the files open while you’re editing them? You can edit and save them as many times as you want before you close them.

The only time I need to change the language is the first time I open either a CSS or an EE template.

Your name is mandatory
Your email address is mandatory
Your comment is mandatory Formatting:
-deleted text-
   What word do you see to the left?
The captcha is mandatory