It will give you a selection when you open a new file in Textmate. It asks you what the file type is and let you select a grammar for the new file.
So how to change the file grammar after I selecting the grammar once?
There's a button on the bottom bar.
You press it, and there they are, all possible syntax modes with their shortcuts:
来源:https://stackoverflow.com/questions/13099383/how-to-change-file-type-in-textmate