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

Merrifield Adam macagp at gmail.com
Mon Jan 24 16:20:43 UTC 2011


I shy away from messing with the language definitions but this is certainly a brilliant tip.

Adam Merrifield
seyDoggy Systems
seydoggy.com

820 Strasburg rd, Kitchener,
Ontario, N2E 2Y3, Canada

Email: info at seydoggy.com
Office: 519-489-6033
Cell: 519-574-9788

On Jan 24, 2011, at 11:02 AM, Sven Axelsson wrote:

> 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
> ++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>> ++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
> +++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.
> 
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate



More information about the textmate mailing list