Appearance & Behavior(外觀和行為)
關(guān)閉Intellij IDEA自動(dòng)更新
File -> Settings -> Appearance & Behavior-> System Settings->Updates,取消勾選Automatically check updates for
設(shè)置主題
File -> Settings -> Apprarance & Behavior -> Theme
設(shè)置窗體及菜單的字體及字體大?。珊雎裕?/h3>
File -> Settings -> Apprarance & Behavior -> Use custom font
設(shè)置編輯區(qū)主題(可忽略)
File -> Settings -> Editor -> Code Scheme -> Scheme
通過插件(plugins)更換主題(可忽略)
File -> Settings -> Plugins -> Marketplace,搜索Material Theme UI
Editor -–> General
設(shè)置鼠標(biāo)滾輪修改字體大小(可忽略)
File -> Settings -> Editor,勾選Change font size (Zoom) with Crtl+Mouse Wheel
設(shè)置鼠標(biāo)懸浮提示
File -> Settings -> Editor,勾選Show quick documentation on mouse move
設(shè)置自動(dòng)導(dǎo)包功能
File -> Settings -> Editor,勾選Add unambiguous imports on the fly和Optimize imports on the fly (for current project)
Add unambiguous imports on the fly:自動(dòng)導(dǎo)入不明確的結(jié)構(gòu);
Optimize imports on the fly: 自動(dòng)幫我們優(yōu)化導(dǎo)入的包
設(shè)置顯示行號(hào)和方法間的分隔符

File -> Settings -> Editor -> General -> Appearance,勾選Show line numbers和Show method separators
忽略大小寫提示
File -> Settings -> Editor -> General -> Code Completion,取消勾選Match case
設(shè)置取消單行tabs的操作
File -> Settings -> Editor -> General -> Editor Tabs,取消勾選Show tabs in one row
Edit --> File Types
隱藏.idea文件夾和.iml等文件
IntelliJ IDEA項(xiàng)目會(huì)自動(dòng)生成一個(gè).idea文件夾和.iml文件,看著實(shí)在是礙眼,所以對(duì)以上文件進(jìn)行隱藏處理。
File -> Settings -> Editor -> File Types下的Ignore files and folders一欄添加 *.idea;*.iml;等配置如下圖所示:

Edit --> Font
設(shè)置默認(rèn)的字體、字體大小、字體行間距
File -> Settings -> Editor -> Font
Editor --> Color Scheme
修改當(dāng)前主題的字體、字體大小、字體行間距( 可忽略)
File -> Settings -> Editor -> Color Scheme -> Color Sheme Font
修改當(dāng)前主題的控制臺(tái)輸出的字體及字體大小( 可忽略)
File -> Settings -> Editor -> Color Scheme -> Console Font
修改代碼中注釋的字體顏色
File -> Settings -> Editor -> Color Scheme -> Language Defaults -> Comments -> Doc Comment -> Text
Editor --> Code Style
設(shè)置超過指定import個(gè)數(shù),改為* ( 可忽略)
File -> Settings -> Editor -> Code Style -> Java -> Imports,修改Class count to use import with '*'
默認(rèn)個(gè)數(shù)為5
修改類頭的文檔注釋信息
File -> Settings -> Editor -> File and Code Templates -> Includes -> File Header
/**
@author tom
@create ${YEAR}-${MONTH}-${DAY} ${TIME}
*/
Editor --> Copyright
設(shè)置版權(quán)
File -> Settings -> Editor -> Copyright -> Copyright Profiles
版權(quán)所有(C),XXX公司,$today.format("yyyy"),所有權(quán)利保留。
項(xiàng)目名: $module.name
文件名: $file.fileName
模塊說明:
修改歷史:
$today.format("yyyy-M-d") - tom - 創(chuàng)建。
Editor --> Inspections
快捷鍵生成serialVersionUID
File -> Settings -> Editor -> Inspections -> Java Serializable issues,勾選Serializable class without 'serialVersionUID'
Editor –-> File Encodings
設(shè)置項(xiàng)目文件編碼
File -> Settings -> Editor -> File Encodings,選擇UTF-8并且勾選Transparent native-to-ascii conversion
設(shè)置當(dāng)前源文件的編碼(可忽略)
對(duì)單獨(dú)文件的編碼修改還可以點(diǎn)擊右下角的編碼設(shè)置區(qū)。如果代碼內(nèi)容中包含中文,則會(huì)彈出如上的操作選擇。 其中:
- Reload表示使用新編碼重新加載,新編碼不會(huì)保存到文件中,重新打開此文件,舊編碼是什么依舊還是什么。
- Convert表示使用新編碼進(jìn)行轉(zhuǎn)換,新編碼會(huì)保存到文件中,重新打開此文件,新編碼是什么則是什么。
注意:含有中文的代碼文件, Convert 之后可能會(huì)使中文變成亂碼,所以在轉(zhuǎn)換前請(qǐng)做好備份,不然可能出現(xiàn)轉(zhuǎn)換后變成亂碼,無法還原。
Build,Execution,Deployment
設(shè)置自動(dòng)編譯
File -> Settings -> Build,Execution,Deployment -> Compiler,選擇Build project automatically和Compile independent modules in parallel
設(shè)置為省電模式(可忽略)
File -> Power Save Mode
省電模式會(huì)關(guān)掉代碼檢查和代碼提示等功能。
設(shè)置代碼水平或垂直顯示
查看文件內(nèi)的多塊代碼時(shí)特別方便

設(shè)置快捷鍵(Keymap)
設(shè)置快捷為 Eclipse 的快捷鍵
File -> Settings -> Keymap,選擇Eclipse
通過快捷鍵功能修改快捷鍵設(shè)置
File -> Settings -> Keymap

通過指定快捷鍵,查看或修改其功能
File -> Settings -> Keymap

安裝插件
RainBow Brackets(彩虹括號(hào))
Maven Helper
ignore
生成各種ignore文件,一鍵創(chuàng)建git ignore文件的模板。
lombok
通過該插件可以生成實(shí)體的GetXXX和SetXXX方法。lombok的注解(@Setter,@Getter,@ToString,@@RequiredArgsConstructor,@EqualsAndHashCode或@Data),需要在項(xiàng)目中添加依賴。
FindBugs-IDEA
檢測(cè)代碼中可能的bug及不規(guī)范的位置。
GsonFormat
根據(jù)json文本生成java類。
VisualVM Launcher
運(yùn)行java程序的時(shí)候啟動(dòng)visualvm,方便查看jvm的情況。
GenerateAllSetter
一鍵調(diào)用一個(gè)對(duì)象的所有set方法并且賦予默認(rèn)值。
Grep console
自定義日志顏色,idea控制臺(tái)可以彩色顯示各種級(jí)別的log,安裝完成后,在console中右鍵就能打開。
Free Mybatis plugin
mybatis 插件,讓你的mybatis.xml像java代碼一樣編輯。
MyBatis Log Plugin
直接將Mybatis執(zhí)行的sql腳本顯示出來,可以直接運(yùn)行。
Restfultookit
可以根據(jù)web訪問的url找到對(duì)應(yīng)的controller類,還可以生成測(cè)試數(shù)據(jù),不用postman來組裝數(shù)據(jù)。
maven配置
安裝maven插件
File -> Settings -> Plugins,Marketplace搜索maven并安裝
maven配置文件路徑修改
File -> Settings -> Build,Excution,Deployment -> Build Tools -> maven,修改User settings file
maven配置repository路徑
File -> Settings -> Build,Excution,Deployment -> Build Tools -> maven,修改Local repository