Intellij IDEA配置優化
1. 線上啟用
安裝IntelliJ IDEA 2016.1.2版本後,在聯網狀態下啟用。Help --> Register,選擇lisence server,貼上地址http://www.iteblog.com/idea/key.php到lisence server address中,點選discover server按鈕即可。
1. 優化JVM引數
修改 IntelliJ IDEA 2016.1.2/bin/idea.exe.vmoptions【記得備份】檔案,如果是x64系統,修改idea64.exe.vmoptions檔案中的引數,具體引數如下:
-Xms512m
-Xmx750m
-Xmn264m
-XX:MaxPermSize=350m
-XX:PermSize=128m
-XX:ReservedCodeCacheSize=240m
-Xverify:none
-Xnoclassgc
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-server
-Dsun.io.useCanonCaches=false
-Dsun.awt.keepWorkingSetOnMinimize=true
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
注:-Xms512m 設定初時的記憶體大小,提高Java程式的啟動速度
-Xmx750m 設定最大記憶體數,提高該值,可以減少記憶體Garage收集的頻率,提高程式效能
-Xverify:none 關閉Java位元組碼驗證,從而加快了類裝入的速度,並使得在僅為驗證目的而啟動的過程中無需裝入類,縮短了啟動時間
-XX:+UseParNewGC 使用並行收集演算法
-server 控制記憶體garage方式,這樣你無需在花一到兩分鐘等待記憶體garage的收集
-Dsun.awt.keepWorkingSetOnMinimize=true 可以讓IDEA最小化到工作列時依然保持以佔有的記憶體,當你重新回到IDEA,能夠被快速顯示,而不是由灰白的介面逐漸顯現整個介面,加快回復到原介面的速度。
2. 基本常用設定
設定外觀字型:File -> Settings -> Appearance & Behavior -> Appearance -> 勾選 Override default fonts by (not Recommended)
設定 Name:微軟雅黑、Size:12、Presentation Mode:24
去掉 Animate windows,勾選 Show tool window bars
啟動時不開啟工程:File -> Settings -> Appearance & Behavior -> System Settings -> Startup/Shutdown 標籤項 -> 去掉 Reopen last project on startup
關閉確認退出選項:File -> Settings -> Appearance & Behavior -> System Settings -> Startup/Shutdown 標籤項 -> 去掉 Confirm application exit
在同一視窗開啟工程:File -> Settings -> Appearance & Behavior -> System Settings -> Project Opening 標籤項 -> 勾選 Open project in ths same window
設定自動儲存:File -> Settings -> Appearance & Behavior -> System Settings -> Synchronization 標籤項 ->
全部勾選包括 Save files automatically.. 然後設定30 sec.
關閉自動檢測新版本更新:File -> Settings -> Appearance & Behavior -> System Settings -> Updates -> 去掉 Automatically check updates for...
關閉IDEA的使用習慣統計:File -> Settings -> Appearance & Behavior -> System Settings -> Usage Statistics -> 去掉 Allow sending...
=======================================================================================================
通過 Ctrl + 滑鼠調整字型:File -> Settings -> Editor -> General -> Mouse 標籤項 -> 勾選 Change font size (Zoom) with Ctrl + Mouse Wheel
讓游標不隨意定位:File -> Settings -> Editor -> General -> Virtual Space 標籤項 -> 去掉 Allow placement of caret after end of line
顯示虛擬空間:File -> Settings -> Editor -> General -> Virtual Space 標籤項 -> 勾選 Show virtual space at file bottom
去除每行多餘空格:File -> Settings -> Editor -> General -> Other 標籤項 -> 設定 Srip trailing spaces on Save,下拉選擇 All
去除光滑滾動:File -> Settings -> Editor -> General -> Scrolling 標籤項 -> 去掉 Smooth scrolling
自動 import 包:File -> Settings -> Editor -> General -> Auto Import -> 勾選 Optimize imports on the fly、Add unambiguous imports on the fly
顯示行號:File -> Settings -> Editor -> General -> Appearance -> 勾選 Show line numbers
顯示空白符:File -> Settings -> Editor -> General -> Appearance -> 勾選 Show whitespaces
程式碼自動補齊(針對小寫):File -> Settings -> Editor -> General -> Code Completion -> Code Completion 標籤項 -> 設定 Case sensitive completion:none
勾選 Autopopup documentation in (ms) : 200,勾選 Parameter in (ms) :200
程式碼摺疊:File -> Settings -> Editor -> General -> Code Folding -> 去掉 One-line methods
用*標識編輯過的檔案:File -> Settings -> Editor -> General -> Editor Tabs -> Tab Appearance 標籤項 -> 勾選 Mark modified tabs with asterisk
限制 Tab 標籤頁數量:File -> Settings -> Editor -> General -> Editor Tabs -> Tab Closing Policy 標籤項 -> 設定 Tab limit :20
輸入“右}”時,不要格式化程式碼塊:File -> Settings -> Editor -> General -> Smart Keys -> 去掉 Reformat block on typing '}'
設定 Reformat on paste :None
程式碼字型風格:File -> Settings -> Editor -> Colors & Fonts -> Font -> 選擇 Darcula 設計,點選 Save As備份一套然後編輯
修改 Primary font 的字型,勾選 Show only monospaced fonts,只顯示等寬字型
設定游標所在行的背景:File -> Settings -> Editor -> Colors & Fonts -> General -> Editor -> Caret row -> Background
取消程式碼拼寫檢查:File -> Settings -> Editor -> Inspections -> Spelling -> Typo -> 去掉 Process code、Process literals、Process comments
統一編碼格式:File -> Settings -> Editor -> File Encodings -> 設定 IDE Encoding、Project Encoding、Defalut encoding for properties files
勾選 Transparent native -to-ascii conversion
過濾的檔案型別及目錄:File -> Settings -> Editor -> File Types -> Ignore files and folders -> 新增 *.iml;*.idea;*.classpath;*.project;*.settings;target;
=======================================================================================================
禁用外掛:File -> Settings -> Plugins -> 如:ASP、Cloud Foundry integration、CloudBees integration、CVS Integration、Flash/Flex Support、
TFS Integration、Google App Engine Integration
=======================================================================================================
備份個性化設定:File -> Export Settings