Force Syntax Highlight for Files? Feature Request

In Sublime Text I can override the extension of a file and make the syntax highlight in any syntax it knows.  

I would like this to be possible in JetBrains IDEs


  • a file has no extension or
  • a file has multiple syntaxes in it
  • (neither are necessarily good practices)

I really need to be able to specify the "syntax highlighting", of the file regardless of its "file type".

This doesn't seem to be possible in PHPStorm and I'm guessing others neither.

Is this possible?  If not, consider this a feature request.


James Saxon
Comment actions Permalink


not sure I've got what you are trying to accomplish... Some examples would be helpful.

for files with multiple syntaxes you can use language injections ( In some cases the languages are injected automatically (like javascript in <script type="text/javascript"> tags, for other you can use custom injections. If you just like to 'override' default highlighting for the certain file (for example, treat 'myFile.php' as HTML), you can add 'myFile.php' to HTML registered patterns in Settings/File types/HTML

See also: and

Comment actions Permalink


This helped to understand that the solution comes from "IntelliLang" via "Language Injections".

While there's no way to simply force a syntax, IntelliLang does a beautiful job.  

With Injections, one can specify another language inline if necessary.

In my case, the issue boiled down to not having a Bash colorizer which I found in third party plugins.

Once I installed that, it was handling files without extensions fine!

Thanks again for the pointers!


Comment actions Permalink

The answer is that IntelliLanga appears to correctly sense languages in all files if it knows the language. If not, there's probably a plugin needed. In this case a bash one. So even without file extensions, languages are sensed correctly.


Please sign in to leave a comment.