Bundle Language Definition for Syntax Highlighting

12 views
Skip to first unread message

GB

unread,
Nov 28, 2010, 9:32:32 PM11/28/10
to cftextmate
Hi All,

I'm really glad to hear fresh activity about Textmate. Over the years
I have tweaked my installation and I am very pleased with it.

There was one point in time where I dig pretty deep into the bundle
language definitions and added a number of changes that really helped
my code syntax highlighting.

In the Bundle Editor (CTRL+OPT+CMD+B), filter for Languages in the
drop-down menu at the top, and click on the one (should only be one
per bundle as far as I know). Mine is in the old Coldfusion bundle, I
forget where I originally got it. Anyway, in there, about half way
down, inside the section where it says "Repository = {" I have added
a new definition as follows:


cftag = {
name = 'meta.tag.cfml';
begin = '</?(?i:cf)';
end = '>';
patterns = (
{ include = '#cftag'; },
{ name = 'string.quoted.double.html';
contentName = 'meta.toc-list.id.html';
begin = '"';
end = '"';
patterns = (
{ include = '#embedded-code'; },
{ include = '#entities'; },
);
},
{ name = 'string.quoted.single.html';
contentName = 'meta.toc-list.id.html';
begin = "'";
end = "'";
patterns = (
{ include = '#embedded-code'; },
{ include = '#entities'; },
);
},
);
};


Note the first line inside the body "name = 'meta.tag.cfml';". with
that 'meta.tag.cfml' hierarchy, or handle, whatever you want to call
it, I was able to add a new line in the (CMD+,[COMMA]) Preferences >
Fonts & Colors for "cfml meta" with the SCOPE SELECTOR being
"meta.tag.cfml,source.sql.embedded.html" and set the color to be
red.

Adding that set apart all CFML tags as a different color from all HTML
tags. It makes the syntax highlighting stronger and easier to read.

I just tested out the new Railo 3.2 bundle and it doesn't have any
syntax highlighting separating CFML from HTML. So I immediately went
back to my old custom version.

A few years ago when I pulled together that language definition pasted
above I barely knew what I was doing.

I throw this out there because it was the buggest struggle when I
first switch to a Mac and Textmate.

Andy Jarrett

unread,
Dec 1, 2010, 7:25:42 AM12/1/10
to cftex...@googlegroups.com
Cheers for that. It was the kind of tweaks that I wanted to get and
bring together.

I'll look at seeing what I can do with the current bundle.

Andy Jarrett
www.andyjarrett.co.uk
cftextmate.andyjarrett.co.uk

Sent from my iPhone

> --
> You received this message because you are subscribed to the Google Groups "cftextmate" group.
> To post to this group, send email to cftex...@googlegroups.com.
> To unsubscribe from this group, send email to cftextmate+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cftextmate?hl=en.
>

Russ Johnson

unread,
Dec 1, 2010, 9:15:01 AM12/1/10
to cftex...@googlegroups.com
I have some updates to my language definition as well that brings full syntax highlighting to pure cfscript pages for CF9...

I will send you my bundle as I have tweaked it considerably and you can run some diffs on it to pull out the bits you want...


Andy Jarrett

unread,
Dec 1, 2010, 11:44:13 AM12/1/10
to cftex...@googlegroups.com
The bundles below should have Script support now 



Andy Jarrett
www.andyjarrett.com
www.linkedin.com/in/andyjarrett

Ξ Please think before you print Ξ
image001.gif
Reply all
Reply to author
Forward
0 new messages