1. 程式人生 > >Eclipse配置和優化

Eclipse配置和優化

1.禁用不需要的外掛:

        座標:windows–->perferences–->general–->startup and shutdown

        關閉的啟動項:

              WTP webservice UI plug-in,        //webservice ui檢視

              Equinox Provisioning platform Automatic Update Support        //自動更新

2.禁止檢查自動更新:

         座標Window --> Preferences --> Install/Update --> Automatic Updates  去掉勾選即可

3.禁用程式碼校驗:

        座標:Window --> Preferences --> Validation       

        預設情況下Eclipse在啟動的時候會自動驗證每個專案的配置檔案(包括html和jsp以及xml等),這是一個非常耗時的過程,需要驗證的時候可以通過手工驗證。          

        把manual 列下面的對勾全部去掉,build下只留 classpath dependency Validator
        手工驗證方法:在要驗證的檔案上,單擊滑鼠右鍵–>myeclipse–>run validation

4.禁用單詞拼寫檢查:

        座標:Window-->General-->Editors-->Text Editors-->Spelling

        去掉Enable spell checking的對勾即可

5.修改Eclipse編輯JSP,xhtml等頁面時的編輯工具:

        座標:Window --> perferences --> General --> Editors --> File Associations 

       在File types 中選擇 *.jsp > 在Associated editors 中將自己要用的設定為預設。

    例如:前端使用Extjs作前端時,jsp頁面習慣設為Text,js用spket外掛展示。

6.eclipse下的編碼設定:

     a. windows-->Preferences-->general-->Workspace 

           右側 Text file encoding,選擇Other,改變為UTF-8,以後工程其屬性對話方塊中的Text file encoding即為UTF-8。

       b. windows-->Preferences-->general->Content Types            

           右側Context Types樹,點開Text,選擇Java Source File,在下面的Default encoding輸入框中輸入UTF-8,點Update,則設定Java檔案編碼為UTF-8。其他java應用開發相關的檔案 如:properties、XML等已經由Eclipse預設指定,分別為ISO8859-1,UTF-8,如開發中確需改變編碼格式則可以在此指定。 

7.設定字型大小:

        座標:window-->perferences-->General-->Appearance-->Colors and Fonts-->Text Font

8.匯入格式化模板:

        座標:Window--> Preferences-->Java--> Code Style --> Formatter

        點選【Import】,選擇dm-codeformatter.xml檔案(見eclipse模板設定),完成後點選OK即可完成配置。

        

        格式化快捷鍵: Ctrl+Shift+F

9.匯入註釋模板:

        座標:Window--> Preferences-->Java--> Code Style -->  Code Templates

        點選【Import】,選擇dm-codetemplates.xml檔案(見eclipse模板設定),完成後點選OK即可完成配置。

        

        註釋快捷鍵: Alt+Shift+J

10.匯出配置檔案: 

      方法一: 使用eclipse的匯出功能(不推薦,有些配置無法匯出)

       File--> Export--> General--> Preferences匯出成epf檔案 ,再File--> Import--> General--> Preferences匯入eclipse中

       方法二: 將workspace/.metadata/.plugins/org.eclipse.core.runtime中的.settings資料夾拷貝出來,裡面就是所有的配置檔案,新建工作空間的時候將該.settings資料夾替換掉新工作空間中的.settings資料夾即可。

        另外,匯出介面上的工具欄對話方塊佈局等:.metadata\.plugins\org.eclipse.e4.workbench將該資料夾儲存起來即可。