Joh*_*ive 4 android intellij-idea android-studio
I have a project with a lot of classes in which I need to change the Created by template.
/**
* Created by johnnyfivedev on 19.07.16.
*/
Run Code Online (Sandbox Code Playgroud)
Since there are a lot of such classes, copy and paste not an option. Rather I want to remove that generated template and regenerate it. Is there any default shortcut for doing this? If not, then how do I create one?
而是我想删除该生成的模板并重新生成它。
您可以肯定地编辑模板,但不能再次重新生成它。我建议编辑模板以备将来使用,并为该模板更改之前创建的模板创建实时模板。
转到设置->编辑器->文件和代码模板->包含->文件头
并${USER}像这样覆盖函数:
#set( $USER = "Your name")
如果需要,可以向其中添加更多变量。
注意:这些更改将仅对新文件生效。在此模板更改之前所做的更改必须手动更改。
按Ctrl+ Alt+ S直接进入“文件和代码模板”选项卡。
转到设置->编辑器->实时模板
按绿色的“加号”以添加新模板,然后选择Live Template。
在abbreviation字段中,输入您要输入的内容annot,然后输入适当的描述(可选),然后在框中插入以下代码:
/**
* Created by $USER$ on $DATE$.
*/
$END$
Run Code Online (Sandbox Code Playgroud)
选中该Edit variables框,然后在相应的字段中输入以下表达式,
user() 给USERdate("dd-MM-yyyy") 在DATE在该类型之后,定义合适的适用上下文。在您的代码中,现在键入annot并按Enter插入模板。
在代码中,你的光标会在这个地方结束了$END$在敲击Enter模板插入后。
| 归档时间: |
|
| 查看次数: |
856 次 |
| 最近记录: |