Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .