在IntelliJ中导入Eclipse Code Formatter

以下设置建议在intelliJ的默认配置下设置,以节省逐个项目配置的时间在IntelliJ中导入Eclipse Code Formatter

1、安装IntelliJ插件Eclipse Code Formatter

在IntelliJ中导入Eclipse Code Formatter

2、安装插件并重启后,在Settings->Other Settings中找到Eclipse Code Formatter,启用设定formatter文件。formatter文件模板课参考页面Eclipse Java代码风格

在IntelliJ中导入Eclipse Code Formatter

3、安装完了之后按Ctrl+Alt+L对代码进行format。也可以选中自己的代码,进行部分格式化。