文章目錄
- 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
即可自動生成注釋;