[TxMt] New Language for Bundle
Chris Ruzin
thatguy at chrisruzin.net
Thu Aug 25 06:40:06 UTC 2005
Just to give everyone an update, I've now got a really basic language
definition working. It folds code where it's supposed to and
highlights EE tags and strings. It will only do this if I choose
ExpressionEngine as the language though. What I'm wanting is to have
EE tags folded and colorized even when HTML is the language.
My definition is small, so I've copied it below for others to
critique. Keep in mind I don't know what the hell I'm doing.
---
{ scopeName = "source.ee";
fileTypes = ( "html", "htm", "php" );
foldingStartMarker = "\\{(exp:([a-zA-Z0-9:]+)|if)\\b.*?\\}";
foldingStopMarker = "\\{/(exp:([a-zA-Z0-9:]+)|if)\\}";
patterns = (
{ name = "constant.tag.ee";
begin = "\\{/?([-a-zA-Z0-9_:]+)";
end = "\\}";
captures = { 1 = { name = "entity.name.tag.html"; }; };
patterns = (
{ name = "declaration.attribute-with-value.id.ee";
match = " (id)=((\"|')(.*?)\\3)";
captures =
{ 1 = { name =
"entity.parameter.attribute.tag.id.html"; };
2 = { name = "string.html"; };
4 = { name = "value.html"; };
};
},
{ name = "entity.parameter.attribute.tag.ee";
match = " ([a-zA-Z-:]+)";
},
{ name = "string.double-quoted.ee";
begin = "\"";
end = "\"";
},
{ name = "string.single-quoted.ee";
begin = "'";
end = "'";
},
);
}
);
}
---
I defined EE tags as constants because I wanted them to stand out
within HTML code. If you see things I'm doing wrong (which I'm sure I
am), please give me some advice/tips/help.
Thanks,
Chris
More information about the textmate
mailing list