Is there a function that just returns the current syntax highlighting/detected file type for the file open in the active window?

Edit: Mmm, using view.syntaxName(0) would seem to work, but it's not that obvious from the documentation at least. Not to mention needlessly wordy by passing an parameter where none should be needed for this use case IMHO.

Edit2: This function seems to return a flat Unicode string consisting of two parts. The first part being specific for the point you call syntaxName() on, the second part identifying the type of file/syntax highlighting applied, e.g.:

A better option is to use the value returned by view.options().get('syntax'), which will give you the path to the tmLanguage used by the current buffer - this is what's used by the status bar to show the current syntax. You'll still have to trim off the path components though to get a friendly name.