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?
Asked
Active
Viewed 5,248 times
2 Answers
14
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.
Per @zengabor in a comment, βIn TextMate 2 the steps are: Bundles > Edit Bundles... > XML > Language Grammars > XML, and then edit the list of "File Types" in the drawer.β
Telemachus
- 7,065
3
Textmate 2 remembers the last language used for an extension.
You could customise the bundle if you wish
- ^β₯β-B (bundle editor) --> language grammars
- Add your extension to the "File Types" list (just click the
+icon
tim
- 409