Intellij idea使用eclipse的java代码格式化文件
生活随笔
收集整理的這篇文章主要介紹了
Intellij idea使用eclipse的java代码格式化文件
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在Intellij idea中導(dǎo)入格式化文件:
1,安裝插件:
網(wǎng)絡(luò)安裝:選擇Setting =>Plugins=>Browse repositories,搜索Eclipse即可出現(xiàn),點(diǎn)擊左上角的Download and Install安裝。安裝之后重啟Intellij,即可在Setting =>Eclipse Code Formatter找到配置項(xiàng)。
硬盤(pán)安裝(推薦):Setting =>Plugins=>Install plugin from disk,選中下載好的安裝包【EclipseFormatter.zip】安裝,重啟后生效;
2,配置插件:
選擇Setting =>Eclipse Code Formatter,勾選Use the Eclipse-code-formatter,并在Eclipse Java Formatter config file選擇Eclipse用的code-style.xml文件,這個(gè)選項(xiàng)會(huì)決定格式化代碼的方式。
同時(shí)配置Import order的From File也為Eclipse用的code-style.xml文件,這個(gè)選項(xiàng)會(huì)決定組織import區(qū)域的方式。
3,使用插件
使用Intellij的格式化快捷鍵"Ctrl+ALT+L"即可進(jìn)行格式化。如果出錯(cuò)會(huì)輸出提示到Event Log里,如果看到'xxx formatted sucessfully by Eclipse code formatter'則表示格式化成功!
1,安裝插件:
網(wǎng)絡(luò)安裝:選擇Setting =>Plugins=>Browse repositories,搜索Eclipse即可出現(xiàn),點(diǎn)擊左上角的Download and Install安裝。安裝之后重啟Intellij,即可在Setting =>Eclipse Code Formatter找到配置項(xiàng)。
硬盤(pán)安裝(推薦):Setting =>Plugins=>Install plugin from disk,選中下載好的安裝包【EclipseFormatter.zip】安裝,重啟后生效;
2,配置插件:
選擇Setting =>Eclipse Code Formatter,勾選Use the Eclipse-code-formatter,并在Eclipse Java Formatter config file選擇Eclipse用的code-style.xml文件,這個(gè)選項(xiàng)會(huì)決定格式化代碼的方式。
同時(shí)配置Import order的From File也為Eclipse用的code-style.xml文件,這個(gè)選項(xiàng)會(huì)決定組織import區(qū)域的方式。
3,使用插件
使用Intellij的格式化快捷鍵"Ctrl+ALT+L"即可進(jìn)行格式化。如果出錯(cuò)會(huì)輸出提示到Event Log里,如果看到'xxx formatted sucessfully by Eclipse code formatter'則表示格式化成功!
補(bǔ)充:
在MyEclipse中導(dǎo)入格式化文件:
window-->preference-->Java-->Code Style-->Formatter ?的Import 選擇code-style.xml文件即可;
總結(jié)
以上是生活随笔為你收集整理的Intellij idea使用eclipse的java代码格式化文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 人声分离攻破“鸡尾酒会”效应,将为语音识
- 下一篇: Dell服务器的iDRAC虚拟控制台无法