1. 在線激活
安裝IntelliJ IDEA版本后,永久激活可參考https://blog.51cto.com/825272560/2350356,親測有效(@2020.02.22)
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