Intellij重新格式化文件保存 [英] Intellij reformat on file save

查看:160
本文介绍了Intellij重新格式化文件保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我记得在IntelliJ或者Eclipse中都可以看到保存的时候重新格式化(清理)文件的设置。如何找到它(在设置中没有找到它)

解决方案

我建议



编辑:它似乎是最近版本的Intellij保存动作插件是由自动Intellij保存。这可能是相当恼人的,当它仍然编辑点击。



这个插件的github问题提供了一些可能的解决方案提示:

https://github.com/dubreuia/intellij -plugin-save-actions / issues / 63

实际上,我尝试将重新格式化为Ctrl + S,并且工作正常 - 现在自动完成保存。

I remember seeing in either IntelliJ or Eclipse the setting to reformat (cleanup) files whenever they are saved. How do I find it (didn't find it in the settings)

解决方案

I suggest the save actions plugin. It also supports optimize imports and rearrange code.

Works well in combination with the eclipse formatter plugin.

Search and activate the plugin:

Configure it:

Edit: it seems like it the recent version of Intellij the save action plugin is triggered by the automatic Intellij save. This can be quite annoying when it hits while still editing.

This github issue of the plugin gives a hint to some possible solutions:

https://github.com/dubreuia/intellij-plugin-save-actions/issues/63

I actually tried to assign reformat to Ctrl+S and it worked fine - saving is done automatically now.

这篇关于Intellij重新格式化文件保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆