注明:
本文為學習記錄筆記,不喜勿噴。有問題請留言。
貼一下自己IDEA的配置及插件
一、配置項
Settings:
1.編寫代碼字型設定:
Editor-->Font :
2.控制台字型:
Editor-->Color Scheme-->Console Font
3.修改字型顔色:
Editor-->Color Scheme-->Console Colors
4.調整編碼格式:
Editor-->File Encodings(把所有編碼都改成utf-8)
(不要勾上Transparent native-to-ascii conversion否則即使你檔案格式是utf-8的,但是在送出代碼或者上傳到伺服器時中文會錯誤的轉換輸出為ascii的就會顯示的亂七八糟)
5.ctrl+滑鼠滾輪改變字型大小
Editor-->General(勾上Change font size(Zoom) with Ctrl+Mouser Whell)
6.滑鼠放在類或方法上時進行文檔提示
Editor-->General(勾上Other中的Show quick documentation on mouse move Delay(ms))
7.方法之間顯示分隔線
Editor-->General-->Appearance(勾上Show method separators)
8.格式化時保留的空行數量
Editor-->Code Style-->Java--Blank Lines(In declarations,In code,Before '}',Between header and package)
9.代碼提示忽略大小寫
Editor-->General-->Code Completion(取消勾選Match case)
10.自動導包
Editor-->General-->Auto Import--Insert imports on paste(選擇All,勾選Add unambiguous imports on the fly和Optimize imports on the fly(for current project))
11.配置JDK
Configure-->Project Defaults-->Project Structure
12.配置JVM參數
Help-->Edit Custom VM Options
Xms:啟動時占用的最小記憶體
Xmx:啟動時占用的最大記憶體
ReservedCodeCacheSize:儲存代碼的緩沖區大小
13.關閉啟動IDEA時自動打開上一次的Project
已經進入Project:File-->Close Projects-->Configure-->Settings-->Appearance&Behavior-->System Settings(勾掉Reopen last project on startup)
未進入則直接從Configure進入
14.将Tomcat加入到IDEA中
File-->Settings-->Build,Execution,Deployment-->Application Servers(選擇+号建立)
15.部署項目到Tomcat
1)右上角方框中選擇Add Configuration-->左上角+号-->Tomcat Server-->Local
2)Application server下拉框選擇對應server
如果Tomcat還沒有加入到IDEA中則選擇Configure點選左上角+号添加
3)熱部署:
選中Deployment欄目
點選Deploy at the server startup空白框右邊的+号選擇對應的項目
Artifact(war explored),External Source
Application context:設定通路項目的根路徑
選擇Server欄目
On Update action 選擇:Redeploy
On frame deactivation 選擇:Update classes and resources
16.依賴包添加到工程中,即eclipse中的build path(此處可以将一個目錄添加進去)
選中右上角Project Structure
選中Libraries點選左上角+号,選擇Java然後選中存放jar包的目錄
選中Modules-->Dependencies,勾選上存放jar包的路徑然後applay生效
17.添加Tomcat編譯環境(即添加servlet包)
選中右上角Project Structure
選中Modules-->Dependencies,選中最右邊的+号,選擇2Library,然後Add Selected
勾選上Tomcat的編譯環境然後apply生效
18.配置maven
File-->Settings-->Build,Execution,Deployment-->Build Tools-->Maven
Maven home directory選擇本地的maven安裝目錄
選擇maven使用的配置檔案User setting file
本地倉庫有的jar可以在填寫pom檔案時直接填寫artifactId會自動填寫groupId
19.配置快捷鍵
File-->Settings-->Keymap(搜尋想要修改的快捷鍵的對應名稱然後添加就可以了)
重命名:Rename;打開檔案位置:show in explorer
20.收起代碼注釋
File-->Settings-->Editor-->General-->Code Folding(勾選上Documentation comments)
21.打開常用工具欄
View-->Toolbar;View-->Tool Buttons
22.安裝插件
File-->Settings-->Plugins || Close Project-->Configure-->Plugins
23.建立類時添加類注釋
File-->Settings-->Editor-->File and Code Templates-->Includes
點加号添加FileHeader
24.修改代碼快捷鍵模闆(例如:main+回車等于main方法)
Editor-->Live Templates
25.隐藏檔案或檔案夾
Editor-->File Types
26.Terminal使用git的bash
Settings-->Terminal
shell path 選擇 git/bin/bash.exe (解決中文亂碼: git/etc/bash.bashrc最後面添加兩行:export export LC_ALL="zh_CN.UTF-8")
27.idea2019.2中文顯示異常
Settings => Editor => Font 将Fallback font改為SimSun,然後重新開機IDEA。Fallback font意思是復原字型,在設定的主字型不包含某些字元(中文字元)時,就會使用Fallback font字型來顯示。SimSun是宋體的英文名稱,2019.2之前版本的IDEA預設的中文字型就是宋體,2019.2不知道改了什麼東西,反正對中文的支援不太好了,需要自己手動設定。
28.idea右側欄不見了
View--Appearance--> Toolbar,Status Bar,Tool Window bars
29.IDEA全屏代碼後左側有很多空白解決方法
View--Appearance--> Exit Distraction Free Mode
30.IDEA中顯示記憶體占用和使用情況
View--Appearance-->Status Bar Widgets-->Memory Indicator
31.IDEA debug模式啟動應用特别慢
去掉Java Filed Watchpoints的斷點(字段上打斷點,有個紅色小眼睛一樣的東西)
二、使用的插件
- lombok:自動生成getter,setter等
- GsonFormat:根據json字元串一鍵生成對應的bean類
- Maven Helper:一鍵檢視maven依賴,檢視沖突依賴,一鍵進行exclude依賴
- Translation:翻譯插件
- MyBatisCodeHelperPro:mybatis代碼自動生成插件
- MyBatis Log Plugin :根據日志生成sql插件 idea2020開始收費,棄用
- SQL Params Setter :根據日志生成sql插件
- Alibaba java code guidelines : 阿裡巴巴代碼規約檢測
- Key Promoter X : 快捷鍵提示插件(用滑鼠進行點選操作時,提示idea的快捷鍵)
- Background Image Plus : 修改背景圖檔(view-->set background image)
- Free Mybatis Plugin : mapper跳轉到對應的mapper.xml檔案對應的statement;生成mapper.xml;生成statement : 跳轉的快捷鍵為ctrl+alt+b(https://github.com/wuzhizhan/free-idea-mybatis/blob/master/README.md)
- VisualVM Launcher : jvisualvm調試插件
- EmmyLua : lua腳本調試插件
- HighlightBracketPair : 括号成對高亮顯示
- SequenceDiagram :方法間調用序列圖
- CodeGlance :代碼縮略圖(類似于vscode的那種)
- RESTfultoolkit :根據url跳轉到對應的controller方法(快捷鍵ctrl+\)