[TxMt] setting a command to all scopes?

Charilaos Skiadas cskiadas at uchicago.edu
Sat Apr 8 00:52:16 UTC 2006


On Apr 7, 2006, at 6:25 PM, Quinn Comendant wrote:

> This seems like it should be obvious, but I can't work it out.
>
> What do I set the Scope Selector to on a command I want to be  
> available
> everywhere? My first intuition is just to leave the Scope Selector  
> field
> blank, but it's not working.

> I have several commands in the text bundle using apple-shift-option-P,
> and one in the HTML bundle. While editing a HTML document when I hit
> this key combo I only get the HTML command, not the others in the  
> text bundle.

TextMate chooses what command to use based on specificity of scope  
selectors. Most specific selectors take precedence. If two commands  
with the same shortcut have the same scope selectors, then it shows  
both up. Otherwise, it executes the one with highest precedence. This  
way you can write a generic command for something, and then override  
its behavior on particular scopes.

So in your case, the generic commands will still work as long as  
there is no command with the same shortcut and a more specific selector.
Try the following: Set the generic commands to have scope  
"text.html," without the quotes (note the comma). This should make  
them work outside of text.html (since they are caught by the empty  
selector following the comma), and also show up when in text.html,  
because of the text.html bit there.

>
> Q

Haris





More information about the textmate mailing list