[TxMt] Re: Variable and Array custom coloring

Allan Odgaard mailinglist at textmate.org
Tue Aug 2 09:56:58 UTC 2011


On 19 Jul 2011, at 00:07, John Relosa wrote:

> Is there a way that I can have a variable declared with a $ symbol and then have it custom colored every time any word has the $symbol in front?

You can setup general rules for coloring: http://manual.macromates.com/en/language_grammars

> Something like 
> 
> declare $variable
> declare %array[]
> 
> so every time these variables appear in the script they would be a certain(assignable) color and a different color for the %array?.

If you want simple pattern-based coloring, the above link explains it all.

If you want to add intelligence, like having $array colored differently than $map then that is not possible (without putting all the variable names in the grammar).



More information about the textmate mailing list