I'm trying to get what seems like a simple custom coloring rule working. As a simple test, I just want to set a custom color for all characters between <code> and </code>.
I added this to the HTML language definition:
{ name = 'markup.code.html'; begin = '<(code)>'; end = '</(code)>'; captures = { 1 = { name = 'entity.name.tag.html'; }; }; patterns = ( { include = '$self'; } ); },
I then went into the Fonts & Colors panel and set a custom color for the scope markup.code.html, but I don't see any effect.
I read Allan's blog post on scopes and it really seems like the above should work, but I'm finding a lot of conflicting information on this topic. The wiki mentions a number of things are out of date so I'm not sure where the authoritative docs are. The blog? The wiki? If so, which page?
The full explanation of scope is useful (assuming it's up to date), but it would be really nice to have some simple, practical examples just to get started. I believe instant gratification as a strong motivator for further research. :)
Thanks!
- Scott
On 22/2/2006, at 10:55, Scott Stevenson wrote:
[...] I then went into the Fonts & Colors panel and set a custom color for the scope markup.code.html, but I don't see any effect.
You can use ctrl-shift P to get the scope of the caret. That way you can easily check what something is matched as.
In your case, it might just be, that your added the rule last in the language grammar, and so, other rules took precedence. Try moving it to the top.
[...] I'm not sure where the authoritative docs are. The blog? The wiki? If so, which page?
The manual: http://macromates.com/textmate/manual/