該配置基於IDEA2020.1版本,如後續有版本更新或者配置變更,再更新
idea64.exe.vmoptions配置
爲提供IDEA啓動速度和性能,需修改該文件中標紅的配置項
`-Xms2048m` # java heap初始值,建議將其與Xmx配置的一樣
`-Xmx2048m` # java heap最大值
`-XX:ReservedCodeCacheSize=1536m` # 預留保存代碼的內存空間
-XX:+UseConcMarkSweepGC # 老年代使用CMS垃圾回收策略(併發標記清除)
-XX:SoftRefLRUPolicyMSPerMB=50 #每兆堆空閒空間中SoftReference的存活時間(單位:秒)
-Xverify:none
-ea # 開啓斷言
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djava.net.preferIPv4Stack=true # 在使用ipv4的主機上運行ip6系統需開啓此項
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
idea.properties
配置一些IDEA的配置、日誌、插件存儲路徑.windows環境下默認存儲在C盤的用戶目錄下,由於會佔用較大空間,建議配置到其他目錄。
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.config.path=D:/Program Files/JetBrains/.IntelliJIdea/config
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.system.path=D:/Program Files/JetBrains/.IntelliJIdea/system
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.plugins.path=${idea.config.path}/plugins
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.log.path=${idea.system.path}/log
常用IDEA插件
僅介紹日常使用的IDEA插件,排名不分先後,根據字母順序排序
- Alibaba Java Coding Guidelines:阿里巴巴代碼規範檢查插件.當前版本爲2.0.2。2.0.1版本將導致IDEA2020.1無法打開設置頁面
- BashSupport:提供bash支持,支持運行配置、語法高亮、重命名、文檔查找、檢查、快速修復等功能
- Chinese (Simplified) Language Pack EAP:IDEA官方漢化插件,用於更好地瞭解IDEA的配置項。因爲不少配置項仍未漢化,所以平常這個插件都是置於disabled。
- Easy Code:基於IntelliJ IDEA開發的代碼生成插件,支持自定義任意模板(Java,html,js,xml)。支持數據庫類型與java類型映射關係配置;
支持同時生成生成多張表的代碼。 - Extra Icons:爲IDEA未設置圖標的文件類型提供圖標配置。
- Free MyBatis plugin:增強idea對mybatis支持的插件,支持生成mapper xml文件、自動補全及語法錯誤提示和從mapper跳轉到mapper.xml
- Git Commit Template:git提交信息模板
- Grep Console:日誌高亮顯示插件
- Maven Helper:更好地管理maven依賴,解決maven衝突等問題
- Rainbow Brackets:給配對括號配置不同顏色插件
- Translation:提供谷歌翻譯、有道翻譯、百度翻譯功能
IDEA詳細配置
僅介紹基於個人習慣而配置的一些選項
- 編輯頁面顯示內存使用情況
菜單欄->View->Appearance->Status Bar Widgets->Memory Indicator - IDEA主題配置
File->Settings->Appearance & Behavior-> Appearance->Theme
- IDEA 菜單欄字體及大小配置
File->Settings->Appearance & Behavior-> Appearance->Use custom font
- 禁止自動打開上次的項目
File->Settings->Appearance & Behavior->System Settings->Reopen last project on startup
- IDEA編輯器主題配置
File->Settings->Editor-> Color Scheme->Shcheme
- 設置鼠標懸浮提示: 當鼠標懸浮與方法名時顯示方法參數等信息
File->Settings->Editor-> Color Editing->Quick Documentation->Show quick documentation on mouse move
- 設置自動導包功能
File->Settings->Editor-> General->Auto Import->Java
Add unambiguous imports on the fly
:自動導入不明確的結構;
Optimize imports on the fly
: 自動優化導入的包
- 忽略大小寫提示
File->Settings->Editor-> General->Code Completion
- 取消單行tabs顯示
File->Settings->Editor-> General->Editor Tabs->Show tabs in one row
- 配置類的文檔註釋信息
File->Settings->Editor-> File and Code Templates->Includes
- 快捷鍵生成serialVersionUID
File->Settings->Editor->Inspections
- 設置文件編碼
File->Settings->Editor->File Encodings
Global Encoding
: 全局編碼
Project Encoding
: 項目編碼
建議全部設置爲utf-8
- 配置自動編譯
File->Settings->Build, Execution, Deployment->Compiler
- debug配置
File->Settings->Build, Execution, Deployment->Debugger
開啓該配置,可減少debug時的內存佔用
- maven配置
File->Settings->Build, Execution, Deployment->Build Tools->Maven
maven home directory
: maven安裝目錄
User settings file
:maven配置文件路徑
Local repository
:maven本地倉庫目錄