保存时自动格式化 Netbeans 中的源代码?

发布于 2024-08-27 13:07:28 字数 172 浏览 3 评论 0原文

我怀念 Eclipse 的一项功能是 保存自动格式化操作。有什么方法可以在 Netbeans 中实现相同的功能吗?

One Feature I miss from Eclipse are Save Actions for autoformatting. Any way to have the same in Netbeans?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月苍老的讽刺 2024-09-03 13:07:28

从 NB 7.3 开始,转到 Tools ->选项->编辑->保存时,

您可以选择重新格式化并删除任何语言的尾随空格。

如果您希望它格式化所有代码,则需要将重新格式化选项指定为“所有行”

Starting with NB 7.3, go to Tools -> Options -> Editor -> On Save

You can select reformat and remove trailing spaces for any language.

You will need to specify the reformat option to "all lines" if you want it to format all of your code

帥小哥 2024-09-03 13:07:28

适用于在 Mac 上运行的 Netbeans 8.2。以下是步骤。

1.单击Netbeans -->首选项

2. 单击“编辑器”选项卡

3. 在编辑器选项卡中单击“保存时”选项卡。

4.单击重新格式化组合框并选择选项“所有行”

就这样,您就完成了。

For Netbeans 8.2 running on Mac. Here are the steps.

1.Click Netbeans --> Preferences

2.Click on the "Editor" tab

3.In the Editor tab click on the "On Save" tab.

4.Click on the Reformat Combo Box and select the option "all lines"

Thats it, you are done.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文