[TxMt] Re: How to change <form> tag coloring?

Sven Axelsson sven.axelsson at gmail.com
Mon Jan 24 16:02:43 UTC 2011


On 24 January 2011 15:53, Joey <commonmind at gmail.com> wrote:
> So, simply put, there really isn't a way to target the specific tag...

Well, maybe "simply put". But you can of course change the language
definition to add support for whatever custom elements you want.

For example, to get support for form coloring you can add this at the
start of the pattern definition in HTML:

		{	name = 'meta.tag.block.form.html';
			begin = '(</?)((?i:form)\b)';
			end = '(>)';
			beginCaptures = {
				1 = { name = 'punctuation.definition.tag.begin.html'; };
				2 = { name = 'entity.name.tag.block.form.html'; };
			};
			endCaptures = { 1 = { name = 'punctuation.definition.tag.end.html'; }; };
			patterns = ( { include = '#tag-stuff'; } );
		},

and then use entity.name.tag.block.form.html in your theme to color the form
tag. Depending on how you want it to look, you may have to add other patterns
to your theme.

-- 
Sven Axelsson
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.


More information about the textmate mailing list