Change default HTML file extension

I'm sure I've overlooked this, but I can't seem to find out how to change the default HTML file extension in the online Help, by searching the Knowledge Base, or by doing a Google search. Under File > Settings > File Types, it lists a number of extensions for HTML files, including *.html and *.htm. However, when I create an HTML file, the drop-down in the HTML File dialog box provides three options: HTML, HTML5, and XHTML. (In contrast, the comparable dialog box for PHP files provides all of the allowable extensions for PHP files.)

I would like to use the *.htm extension for my HTML files, but I can't seem to do that. If I type in something like myfile.htm in the HTML File dialog box, my file comes out named myfile.htm.html. Sort of using the generic File type of file to be created, it seems that I am forced to use the *.html extension. Surely there is some way to change that default or list the *.htm extension in the drop-down. Can anyone help?

I so rarely create static HTML files that this has never been a problem for me before, but I now have to create a variety of HTML files, and this behavior has become quite annoying.

Comment actions Permalink

Hi there,

I do not think it can be done since those dialogs were made (hardcoded) just like that -- PHP one has such option while HTML one does not have it.

The only ways you can do this:

  • Create your own NEW template for HTML file (do not edit existing, but create new one with htm extension -- it will be listed separately) and use it instead
  • Just use "New | File" which will create an EMPTY file -- you will need to enter full file name (I mean -- including extension). You can then use Emet or some Live Template to quickly fill it with some skeleton content/structure.
Comment actions Permalink

Thanks, Andriy. I thought I had to be going blind and just couldn't find the obvious. It helps to know that such was not the case, but now I can't figure out how the developers of PhpStorm left out the possibility of the nearly universally-used *.htm extension. I'm probably going to go with the empty File option using a Live Template to fill in all the repetitive <htm;, <head>, <body> stuff, but it's really annoying that you have to go through that for such a common, ordinary function.

Comment actions Permalink

1) AFAIK HTML file templates are platform-wide feature -- it's not part of PHP supprot plugin as they are available in all IDEA-based IDEs. It's not PhpStorm-specific issue, IMO.

2) I personally always thought that .html is more widely used these days (times of 3-characters for file extension DOS restriction are long gone).

3) Issue Tracker is located here -- you are always welcome to file Feature Request ticket for any missing functionality


Please sign in to leave a comment.