Code highlighting for custom file extensions


Is there any way we could specify code highlighting aliases for custom file extensions? We’re using an XML-ish format, .iml, which would highlight just fine, but for other reasons we don’t necessarily want to use the .xml extension.


I had the same lack of highlighting editing xhtml files which have an xhtml extension.

Based on Syntax highlighting for jsx in .js files?

I now use this bookmarklet

    javascript:(function() {   application.editor().setOption("mode", "text/xml"); 
                               CodeMirror.autoLoadMode(application.editor(), "xml"); })() documents how to use setOptions, in particular “mode”. For example one could also provide xml mode option, it seems.