idea常用配置

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 flyOptimize 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 numbersShow 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 automaticallyCompile independent modules in parallel

設(shè)置為省電模式(可忽略)

File -> Power Save Mode

省電模式會(huì)關(guān)掉代碼檢查和代碼提示等功能。

設(shè)置代碼水平或垂直顯示

查看文件內(nèi)的多塊代碼時(shí)特別方便


設(shè)置代碼水平或垂直顯示

設(shè)置快捷鍵(Keymap)

設(shè)置快捷為 Eclipse 的快捷鍵

File -> Settings -> Keymap,選擇Eclipse

通過快捷鍵功能修改快捷鍵設(shè)置

File -> Settings -> Keymap

通過快捷鍵功能修改快捷鍵設(shè)置

通過指定快捷鍵,查看或修改其功能

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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 在這里總結(jié)下我個(gè)人常用的idea配置。不定時(shí)更新 字體樣式和大小修改 設(shè)置路徑:File>Settings>Eid...
    帥氣滴糟老頭閱讀 12,631評(píng)論 0 36
  • Idea常用設(shè)置 代碼補(bǔ)全取消區(qū)分大小寫 IntelliJ IDEA 的代碼提示和補(bǔ)充功能有一個(gè)特性:區(qū)分大小寫。...
    帷幄庸者閱讀 1,995評(píng)論 0 21
  • 前兩章講解了idea的git、maven、jdk、tomcat、編碼等基本配置,可以讓你的項(xiàng)目正常運(yùn)行,這一章將講...
    楓子夜閱讀 314評(píng)論 2 0
  • 本文介紹 IntelliJ IDEA 常用配置。 目錄 設(shè)置方法 配置 File Encodings 配置 Mav...
    又語閱讀 553評(píng)論 0 0
  • 新建java工程File ->New->Project,如圖示,依次nextimage.png 新建java類im...
    哈斯勒閱讀 908評(píng)論 0 0

友情鏈接更多精彩內(nèi)容