1. 程式人生 > 實用技巧 >Idea常用設定

Idea常用設定

一,配置Idea

  兩種進入配置方式

  a,File --> Setting,只配置當前專案,當再新建一個專案時需要再重新配置

  b,OhterSetting --> SettingForNewProject,預設的全域性配置 

  

  1,目錄結構

  

  2,設定滑鼠懸浮提示

  

  3,自動導包功能

    Add unambiguous imports on the fly:自動匯入不明確的結構

    Optimize imports on the fly:自動幫我們優化匯入的包

  

  4,設定顯示行號和方法間的分隔符
  

  5,忽略大小寫提示

  

  6,設定取消單行顯示 tabs 的操作    

      在開啟很多檔案的時候,IntelliJ IDEA 預設是把所有開啟的檔名 Tab 單行顯示的。但是我個人現在的習慣是使用多行,多行效率比單行高,因為單行會隱藏超過介面部分 Tab,這樣找檔案不方便

  

  7,設定預設 的 字型、字型大小、字型行間距

  

  8, 修改程式碼 中 註釋的字型顏色

      Doc Comment – Text:修改文件註釋的字型顏色

      Block comment:修改多行註釋的字型顏色

      Line comment:修改當行註釋的字型顏色

  

  9,設定超過指定 import 個數,改為* ( 可忽略)

  

  10,修改類頭的文件註釋資訊

  

  常用的預設的變數,這裡直接貼出官網給的    

${PACKAGE_NAME} - the name of the target package where the new class or interface will be created.
${PROJECT_NAME} - the name of the current project.
${FILE_NAME} - the name of the PHP file that will be created.
${NAME} - the name of the new file which you specify in the New File dialog box during the file creation.
${USER} - the login name of the current user.
${DATE} - the current system date.
${TIME} - the current system time.
${YEAR} - the current year.
${MONTH} - the current month.
${DAY} - the current day of the month.
${HOUR} - the current hour.
${MINUTE} - the current minute.
${PRODUCT_NAME} - the name of the IDE in which the file will be created.
${MONTH_NAME_SHORT} - the first 3 letters of the month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL} - full name of a month. Example: January, February, etc.

  11,設定專案檔案編碼      

    說明:Transparent native-to-ascii conversion 主要用於轉換 ascii,一般都要勾選,不然 Properties 檔案中的註釋顯示的都不會是中文。

  

  12,設定自動編譯

    構建就是以我們編寫的 java 程式碼、框架配置檔案、國際化等其他資原始檔、JSP 頁面和圖片等資源作為“原材料”,去“生產”出一個可以執行的專案的過程

     Intellij Idea 預設狀態為不自動編譯狀態,Eclipse 預設為自動編譯:很多朋友都是從 Eclipse 轉到 Intellij 的,這常常導致我們在需要操作 class 檔案時忘記對修改後的 java 類檔案進行重新編譯,從而對舊檔案進行了操作。

  

  13,設定快捷為 Eclipse 的快捷鍵

  

  13,通過 快捷鍵功能 修改快捷鍵設定

  

 14,匯入已有的設定