IDEA自定义模板

RT,虽然看起来简单,每当配置新的IDEA 时,又不免度娘,所以整理下

1.类的模板

  • 路径: settings-Editor-File and Code Templates

  • 右侧找到 class 添加如下,在类的上面

/**
 * @Author taozhaoyang
 * @Description //TODO $DESC$
 * @Date ${DATE} ${TIME}
 **/
  • 新建类,自动回填,效果
/**
 * @Author taozhaoyang
 * @Description //TODO SSS$
 * @Date 2018/7/26 20:15
 **/
public class Test { } 

2. 方法模板

  • 路径: settings-Editor-Live Templates

  • 新建分组 myselfTemplate

  • 分组下新建模板,名称为: *

  • 模板内容设为:

*
 * @Author taozhaoyang
 * @Description //TODO $end$
 * @Date $time$ $date$
 * @Param $param$ * @return $return$ **/ 
  • Expand with Enter
  • Edit Variables
time  time()
date  date()
param methodParameters() return methordReturnType() 
  • Applicable in Java
  • 新建方法,输入: "/*" 加上 "Enter"
  • 效果如下:
    /**
     * @Author taozhaoyang
     * @Description //TODO 
     * @Date 20:27 2018/7/26
     * @Param [args] * @return void **/ public static void main(String[] args) { }

猜你喜欢

转载自www.cnblogs.com/Profound/p/9374304.html