Settings中
File > Other Settings > Default Settings … > Editor > File and Code Templates
配置方式

也可以写死:
/**
*
* @author yourname
* @date ${DATE} ${TIME}
*/
In this template, you can specify a code fragment to be included into file templates (Templates tab) with the help of the #parse directive. One template can be shared by several file templates. Along with static text, code and comments, you can also use predefined variables that will then be expanded like macros into the corresponding values.
Predefined variables will take the following values:
${PACKAGE_NAME}
name of the package in which the new file is created
${USER}
current user system login name
${DATE}
current system date
${TIME}
current system time
${YEAR}
current year
${MONTH}
current

本文介绍了如何在IntelliJ IDEA中配置注释模板。通过进入Settings,选择Default Settings,然后导航到Editor > File and Code Templates进行设置。模板可以自定义,配置完成后,新建一个class文件即可立即验证效果,不需要重启IDEA。
最低0.47元/天 解锁文章
1186

被折叠的 条评论
为什么被折叠?



