Sublime Forum

Determine syntax based on file name *prefix*?

#1

Hi,

I’m working with files in an XML dialect. I’ve got a specialized language for it. All the file names in that dialect start with “a_” and end with “.xml”. Is it possible to auto-select my language for all files named “a_.xml" without selecting my language for all ".xml” files?

Thanks,
Kai

0 Likes

#2

This fork of the SetSyntax plugin will allow you to specify a regular expression when matching filenames:

github.com/schovi/SetSyntax

This will be rolled into the main plugin eventually.

0 Likes

#3

SetSyntax has been retired, use DetectSyntax instead, it uses regex for matching and is much more powerful.

0 Likes