Search code examples
webstorm

How can I change the template comment on new file creation?


When I create a new javascript file, a template like comment is added at the top of the file that looks like this:

/**
 * Created by User on 2015-03-29.
 */

I would like to modify this template, but I cannot for the life of me figure out how.

In the settings page, I have tried searching for 'IDE settings', 'File and Coding Template' (as it would be in PHPStorm, I believe), 'Copyright' (as in IntelliJ), 'header', 'template', 'comment' and different combinations of those terms. But none of these terms result in anything relevant. And searching on google is difficult, because most links take you to PHPStorm or IntelliJ help docs.

Maybe my google-fu is off today...


Solution

  • Settings (Preferences on Mac) | Editor | File and Code Templates | Templates -- you need JavaScript File entry.

    enter image description here


    And searching on google is difficult, because most links take you to PHPStorm or IntelliJ help docs.

    Well ... PhpStorm = WebStorm + PHP + Databases -- in terms of settings it is exactly the same... (comparable builds of course)

    P.S. In previous versions (WebStorm v8, PhpStorm v8.0.1 and older, IntelliJ v13) all Settings were in single column but separated in 2 groups: "Project Settings" on top and then "IDE Settings" on the bottom of the list. In current versions all settings are mixed together using collapsible tree structure and you have to look for special icon next to the settings section name -- it will tell if you this is an IDE wide setting or project specific.