IDEA 基本環境設置
- 調取settings面板
- 1.設置鼠標滾輪修改字體大小(可忽略)
- 2.鼠標懸浮提示
- 3.設置自動導包
- 4.設置顯示行號和方法間的分隔符
- 5.忽略大小寫提示
- 6.設置取消單行顯示tabs的操作
- 7.設置超過指定import個數改爲 * ( 可忽略 )
- 8.修改類頭的文檔註釋信息
調取settings面板
- 調出設置面板的方法:
- 按住快捷鍵
Ctrl+Alt+s
- 左上角
File
->Settings..
- 按住快捷鍵
1.設置鼠標滾輪修改字體大小(可忽略)
- 我們可以勾選此設置後,增加
Ctrl + 鼠標滾輪
快捷鍵來控制代碼字體大小顯
2.鼠標懸浮提示
3.設置自動導包
- Add unambiguous imports on the fly:自動導入不明確的結構
- Optimize imports on the fly:自動幫我們優化導入的包
4.設置顯示行號和方法間的分隔符
- 如上圖紅圈所示,可以勾選 Show line numbers:顯示行數。我建議一般這個要勾選上。
- 如上圖紅圈所示,可以勾選 Show method separators: 顯示方法分隔線。這種線有助於我們區分開方法,所以建議勾選上。
5.忽略大小寫提示
- IntelliJ IDEA 的代碼提示和補充功能有一個特性:區分大小寫。如上圖標註所示,默認就是 First letter 區分大小寫的。
- 區分大小寫的情況是這樣的:比如我們在 Java 代碼文件中輸入 stringBuffer, IntelliJ IDEA 默認是不會幫我們提示或是代碼補充的,但是如果我們輸入StringBuffer 就可以進行代碼提示和補充。
- 如果想不區分大小寫的話,改爲 None 選項即可。
6.設置取消單行顯示tabs的操作
如上圖標註所示,在打開很多文件的時候,IntelliJ IDEA 默認是把所有打開的文
件名 Tab 單行顯示的。但是我個人現在的習慣是使用多行,多行效率比單行高, 因爲單行會隱藏超過界面部分 Tab,這樣找文件不方便。
7.設置超過指定import個數改爲 * ( 可忽略 )
8.修改類頭的文檔註釋信息
/**
@author congcong
@create ${YEAR}-${MONTH}-${DAY} ${TIME}
*/
常用的預設的變量,這裏直接貼出官網給的:
${PACKAGE_NAME} - the name of the target package where the new class or interface will be created.
${PROJECT_NAME} - the name of the current project.
${FILE_NAME} - the name of the PHP file that will be created.
${NAME} - the name of the new file which you specify in the New File dialog box during the file
creation.
${USER} - the login name of the current user.
${DATE} - the current system date.
${TIME} - the current system time.
${YEAR} - the current year.
${MONTH} - the current month.
${DAY} - the current day of the month.
${HOUR} - the current hour.
${MINUTE} - the current minute.
${PRODUCT_NAME} - the name of the IDE in which the file will be created.
${MONTH_NAME_SHORT} - the first 3 letters of the month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL} - full name of a month. Example: January, February, etc.