Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like TextMate to recognize that RDF files are XML and highlight them as such but I can't seem to find a way to do this through the UI. Is there a way to add file extension/type associations?

share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

In the menu, go to Bundles -> Bundle Editor -> Edit Languages -> XML -> XML. (That is, in the section XML, you have both XML and XSL.)

Then in the grammar you will see in the right pane, add RDF files to the fileTypes section. (That section is right at the top of the grammar in this case, but as @umassthrower points out, it may be later.):

    {   scopeName = 'text.xml';
        fileTypes = ( 'xml', 'tld', 'jsp', 'pt', 'cpt', 'dtml', 'rss', 'opml' );

See this link for more gory details on filetype associations.

share|improve this answer
    
For other languages fileTypes isn't necessarily right at the top. For example, it was 2 - 3 pages down for me for ruby. Thanks for the answer though Telemachus. –  umassthrower Aug 11 '12 at 15:39
    
@umassthrower Thanks for letting me know that. I generalized too quickly. Updated the answer to make that clearer. –  Telemachus Aug 12 '12 at 1:05
add comment

Textmate 2 remembers the last language used for an extension.

You could customise the bundle if you wish

  1. ^⌥⌘-B (bundle editor) --> language grammars
  2. Add your extension to the "File Types" list (just click the + icon
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.