idea使用eclipse代码格式化风格

1.一般我们使用Eclipse会统一的code-style.xml文件。Intellij里无法直接导入这个文件,不过有一个插件Eclipse Code Formatter可以完成这个任务

2.选择Setting =>Plugins=>Browse repositories,搜索Eclipse即可出现,点击左上角的Download and Install安装。安装之后重启Intellij,即可在Setting =>Eclipse Code Formatter找到配置项

3.选择Setting =>Eclipse Code Formatter,勾选Use the Eclipse-code-formatter,并在Eclipse Java Formatter config file选择Eclipse用的code-style.xml文件,这个选项会决定格式化代码的方式。同时配置Import orderFrom File也为Eclipse用的code-style.xml文件,这个选项会决定组织import区域的方式


你可能感兴趣的:(idea使用eclipse代码格式化风格)