1. 程式人生 > >Eclipse Code Formatter在IDEA中配置

Eclipse Code Formatter在IDEA中配置

硬碟安裝:Setting =>Plugins=>Install plugin from disk,選中下載前往下載好的安裝包【EclipseFormatter.zip】安裝,重啟後生效;

選擇Setting => Eclipse Code Formatter,勾選Use the Eclipse-code-formatter,並在Eclipse Java Formatter config file選擇Eclipse用的code-style.xml檔案,這個選項會決定格式化程式碼的方式。再選擇Java formatter profile 為剛剛匯入的檔案。同時配置Import order的From File也為Eclipse用的code-style.xml檔案,這個選項會決定組織import區域的方式。

使用Intellij的格式化快捷鍵”Ctrl+ALT+L”即可進行格式化。如果出錯會輸出提示到Event Log裡,如果看到’xxx formatted sucessfully by Eclipse code formatter’則表示格式化成功!

此為轉載內容,但是忘了從哪裡轉的...............................................罪過罪過!