如何在WebStorm中创建新文件时更改显示的文件模板?

时间:2016-04-07 09:53:40

标签: ide editor phpstorm webstorm jetbrains-ide

尝试在WebStorm中创建新文件时,我无法看到我想要使用的文件模板(在本例中为Less)。它存在于我的文件模板中,但不会显示在新文件选择器下拉列表中。

这是我的新文件选择器下拉列表:

enter image description here

这是我的文件模板:

enter image description here

1 个答案:

答案 0 :(得分:3)

To reduce "New File" menu size, some of the bundled (default) similar file templates are grouped under the single menu entry which has drop down box where you can choose the particular kind of template to use. Examples of such grouped/gateway entries are: "HTML File", "Stylesheet", "JavaScript File", "PHP Class" etc.

In your particular case you need to use "Stylesheet" entry where you can choose "Less File":

enter image description here

Some notes:

  1. IDE will remember the "Kind" value that you have used when you use this dialog again.
  2. There is no need to use mouse or keyboard to switch to the "Kind" filed at all -- just use Arrow Up/Down keys when typing file name -- they will switch the "Kind" directly from there.
  3. If you create custom file template (e.g. "Less file 2") it will not be grouped/accessible via such dialog -- it will be listed as separate entry in "New" menu.