文章目录
- IDEA开发工具常用配置
-
- 展示工具栏
- 设置代码自动提示快捷键:
- 调整字体大小
- 设置终端为git bash:
- 设置类注释(创建类时自动生成类注释):
- 设置方法注释:
IDEA开发工具常用配置
展示工具栏
依次点击View->Appearance->Toolbar,在Toolbar上打勾;
改动前效果:

改动后效果:
设置代码自动提示快捷键:
依次点击File->Settings->Keymap->Main Menu->Code->Code Completion->Basic,设置快捷键为
Alt + /
,默认为
Ctrl + Space
;
调整字体大小
依次点击File->Settings->Editor->Font->Size;
设置终端为git bash:
依次点击File->Settings->Tools->Terminal->Shell path;将路径改为git的安装路径,例如:
C:\Program Files (local)\Git\bin\bash.exe
设置类注释(创建类时自动生成类注释):
依次点击File->Settings->Editor->File and Code Templates->Includes->File Header;输入自定义注释格式
/**
* @Title: ${NAME}
* @Package ${PACKAGE_NAME}
* @Description:
* @author test
* @date ${DATE} ${TIME}
*/
变量 | 注释 |
---|---|
${NAME} | File name |
${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 month |
${MONTH_NAME_SHORT} | First 3 letters of the current month name. Example: Jan, Feb, etc. |
${MONTH_NAME_FULL} | Full name of the current month. Example: January, February, etc. |
${DAY} | Current day of the month |
${DAY_NAME_SHORT} | First 3 letters of the current day name. Example: Mon, Tue, etc. |
${DAY_NAME_FULL} | Full name of the current day. Example: Monday, Tuesday, etc. |
${HOUR} | Current hour |
${MINUTE} | Current minute |
${PROJECT_NAME} | Name of the current project |
设置方法注释:
依次点击File->Settings->Editor->Live Templates;
添加用户自定义组:
在组内添加动态模板:
Abbreviation填写
*
Template text填写自定义格式:
*
* @Author test
* @Description:
* @Param $param$
* @return $return$
* @Date $date$ $time$
*/
Define中选择Java;
Expand with选择Enter;
最后点击Edit variables修改变量;
在方法上输入
/** + Enter
即可自动生成注释;