[TxMt] Way to remember what language I'm using

Michael Jackson mjijackson at gmail.com
Sun Mar 11 05:43:10 UTC 2007


On Mar 10, 2007, at 5:57 PM, Allan Odgaard wrote:

>>> If you go to the bundle editor and locate the CSS language  
>>> grammar, you can put ‘css.php’ in the file types array, that  
>>> should make it treat files with this double extension as CSS.
>>
>> I tried to follow these instructions but no luck. I modified the  
>> fileTypes array in the CSS language file to look like this:
>>
>> fileTypes = ( 'css', 'css.php' );
>>
>> but TM still won't recognize the css.php extension as CSS.  
>> Instead, it reverts to PHP every time. Any ideas as to why this is  
>> happening?
>
> You say *revery* -- what happens if you do: mate /tmp/test.css.php?
>
> I did test it, and it works fine for me.
>
> You can see which file type bindings TM has stored (as memory) by  
> running this from Terminal:
>
>     defaults read com.macromates.textmate OakLanguageFileBindings
>
> I don’t think it will ever store a double-extension binding, but I  
> honestly can’t remember, so to clear the memory, quit TM and run:
>
>     defaults delete com.macromates.textmate OakLanguageFileBindings
>
> Also, be sure to have closed the bundle editor, after you edited  
> the CSS grammar (for changes to be committed).

Well, it's true what you say. I can delete all of the defaults and  
do: mate /tmp/test.css.php from the command line, and it will open up  
the file as CSS. However, afterwards if I do: mate /tmp/test.php, it  
will open up as HTML! So then, when I manually change that one back  
to php, the mate /tmp/test.css.php will open up as php! I don't think  
TM has the support for double extensions, but it would be nice in  
this instance.

By the way Allan, I love the editor. Thanks for your help and keep up  
the great work.


More information about the textmate mailing list