我们在写代码的时候,文件头都会有文件的描述、作者、时间、版本等信息,例如下面就是一个标准的文件头模板
/**
* Description: <${NAME}><br>
* Author: ${USER}<br>
* Date: ${DATE}<br>
* Version: V1.0.0<br>
* Update: <br>
*/
模板里面的配置的变量都有以下:
Variable |
Description |
---|---|
${DATE} |
Current system date |
${DAY} |
Current day of the month |
${DS} |
Dollar sign ( |
${END} |
Caret position after you finish editing the variables |
${FILE_NAME} |
Name of the new PHP file (if the PHP plugin is enabled) |
${HOUR} |
Current hour |
${MINUTE} |
Current minute |
${MONTH} |
Current month |
${MONTH_NAME_FULL} |
Full name of the current month (January, February, etc.) |
${MONTH_NAME_SHORT} |
First three letters of the current month name (Jan, Feb, etc.) |
${NAME} |
Name of the new entity (file, class, interface, and so on) |
${PACKAGE_NAME} |
Name of the target package where the new class or interface file is created |
${PRODUCT_NAME} |
Name of the IDE (for example, IntelliJ IDEA) |
${PROJECT_NAME} |
Name of the current project |
${TIME} |
Current system time |
${USER} |
Login name of the current user |
${YEAR} |
Current year |
更多用法请参阅:
https://www.jetbrains.com/help/idea/file-template-variables.html