[TxMt] Creating plist for SuperCollider file type: .sc

Allan Odgaard allan at macromates.com
Tue Aug 9 12:08:20 UTC 2005


On 09/08/2005, at 4.41, Iannis Zannos wrote:

> I started by duplicating the entry for c++ and editing the initial  
> entries as follows:
>
> {   scopeName = "source.sc";
>     fileTypes = ( "sc", "rtf", "txt" );
>
> However this did not work. It works for files of name
> <filename>.sc.rtf, <filename>.sc.txt but not for <filename>.sc

You can put double extensions in the array, so I'd suggest:

    fileTypes = ( "sc", "sc.rtf", "sc.txt" );

That way, txt is still plain text.

As for it not working for sc -- what file type does .sc file open as?  
This array in the language grammar is only referenced when TM has no  
stored binding for the extension.

So if you sometime in the past opened a .sc file, and changed  
language (e.g. to C++) then all future .sc files will open as that  
language, no matter what the grammar files say.

You can inspect the stored associations by using the (incomplete)  
Edit File Associations… from the TextMate menu.

If it does have a binding stored for .sc, simply open an .sc file,  
select View -> Language -> SuperCollider, and it should work as you  
want.





More information about the textmate mailing list