在方法上標注注釋
1:idea左上角點擊Preferences
選擇Editor------Code Style----Live Templates
點擊右邊+號
點擊Template Group,在彈框中添加一個分組
?
2:擊Template Group,在彈框中添加一個分組
?
3:選中新建的分組,點擊右邊+號,選擇Live Template
?
?
4:在Abbreviation后面輸入一個*號
在Template text里面輸入如下內容
以下是你要復制粘貼的注釋模板,我也給你準備好了,在你新建個類的時候,就自動為你添加上啦:
/*** Created with IntelliJ IDEA.* @Auther: 你的名字* @Date: ${YEAR}/${MONTH}/${DAY}/${TIME}* @Description: */
修改@Auther 為你的名字
點擊Define,勾選Everywhere
?
擊Define,勾選Everywhere
?
5:點擊Edit variables,選擇params,returns,date中內容
?
?
?
在方法上面輸入 /**,按tab鍵
?
按tab鍵盤,結果如下

?
idea類上面的注釋
選擇Editor---->File and Code Templates --->Includes--->File Header:
右邊方框中輸入如下
* @Description: * @Auther: 你的名字* @Date: ${YEAR}/${MONTH}/${DAY}/${TIME}*/
復制就可以了

測試結果如下
