[TxMt] scope and themes

Allan Odgaard allan at macromates.com
Sun Sep 4 18:51:15 UTC 2005


On 04/09/2005, at 20.19, Caio Chassot wrote:

> I'm playing with the theme editor and sometimes I'm not sure what  
> the scope for a certain item is. I'd like to know if there's an  
> easy way to get the full scope selector for the text under the cursor.

Ctrl-shift-P. It's actually just a command (in the language  
definition bundle) which does: echo $TM_SCOPE and shows that as a  
tool tip.

> Also, knowing the scope, I wonder how to get the rules that apply  
> to it.

You can always use the exact scope as the “rule”. Scopes work a bit  
like CSS selectors.

I describe this in: http://macromates.com/blog/archives/2005/07/06/ 
introduction-to-scopes/

Since then I have added the ability to and, or, and subtract scope  
selectors, briefly mentioned in latest blog entry (with example) and  
full details in b17 release notes.

> Lastly, is there an straightforward way to revert a color after  
> changing it? Or at least to leave the editor without saving?

Currently not -- though to reset a theme to defaults, you can delete  
the changed theme, which is saved to ~/Library/Application Support/ 
TextMate/Themes.

I do plan to add undo and/or a confirmation requester (before save)  
though.




More information about the textmate mailing list