Often I write small command line utilities and will use alternate languages to create these scripts (e.g. node.js, php, etc.). When I create these files, I use a standard
#! to start the file to indicate to the shell what the intepreter should be. For example, for a node.js script, I’d put this at the top:
In PHPStorm/WebStorm, the syntax highlighting works fine as long as the file has the extension of
Is there any way within the JetBrains IDE’s to set the syntax of an individual file beyond just registering a file type based on file extension?
PhpStorm/WebStorm (as well as whole IDEA platform) does not have ability for user to change custom language / syntax highlighting on the go (whenever you want) — it has to be associated with certain file type.
Of course — implementing this (shebang recognition) via plugin is possible — just like it is implemented for PHP files.
On one hand there is http://youtrack.jetbrains.com/issue/WEB-11842 — vote/star/comment to get notified on progress
You can clarify the actual status of this feature in that ticket.