`
wanxiaotao12
  • 浏览: 457029 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ECLIPSE、INTELLIJ IDEA格式化统一ECLIPSE CODE FORMATTER

    博客分类:
  • idea
 
阅读更多

转自:http://www.yneit.com/2015/01/eclipse%E3%80%81intellij-idea%E6%A0%BC%E5%BC%8F%E5%8C%96%E7%BB%9F%E4%B8%80eclipse-code-formatter.html

 

Eclipse、Intellij idea格式化结果不一样,导致长时间都是用两个开发工具,idea开发eclipse进行格式化。但是现在这个问题可以解决了。使用Eclipse Code Formatter。

具体的插件地址:http://plugins.jetbrains.com/plugin/6546?pr=idea&offset=15&max=15#comments_pan

Intellij idea:
1,安装插件:
网络安装:选择Setting =>Plugins=>Browse repositories,搜索Eclipse即可出现,点击左上角的Download and Install安装。安装之后重启Intellij,即可在Setting =>Eclipse Code Formatter找到配置项。
硬盘安装(推荐):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文件,这个选项会决定格式化代码的方式。
同时配置Import order的From File也为Eclipse用的code-style.xml文件,这个选项会决定组织import区域的方式。
3,使用插件
使用Intellij的格式化快捷键”Ctrl+ALT+L”即可进行格式化。如果出错会输出提示到Event Log里,如果看到’xxx formatted sucessfully by Eclipse code formatter’则表示格式化成功!

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics