Eclipse 中的自动对齐快捷键是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2378258/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:14:32  来源:igfitidea点击:

What is the Auto-Alignment Shortcut Key in Eclipse?

eclipsealignmenteclipse-3.4

提问by Praveen

What is the auto-alignment shortcut key in Eclipse?

Eclipse 中的自动对齐快捷键是什么?

回答by Peter Perhá?

Ctrl+Shift+Fto invoke the Auto Formatter

Ctrl+ Shift+F调用自动格式化程序

Ctrl+Ito indent the selected part (or all) of you code.

Ctrl+I缩进代码的选定部分(或全部)。

回答by Joey

Auto-alignment? Lawful good?

自动对齐?合法的货物?

If you mean formatting, then Ctrl+Shift+F.

如果你的意思是格式化,那么Ctrl+ Shift+ F

回答by djeikyb

The answer that the OP accepted is wildly different from the question I thought was asked. I thought the OP wanted a way to auto-align =signs or +signs, similar to the tabularize plugin for vim.

OP 接受的答案与我认为被问到的问题大不相同。我认为 OP 想要一种自动对齐=标志或+标志的方法,类似于 vim 的 tabularize 插件。

For thistask, I found the Columns4Eclipseplugin to be just what I needed.

对于这项任务,我发现Columns4Eclipse插件正是我所需要的。

回答by jai

Want to format it automatically when you save the file???

想要在保存文件时自动格式化???

then Goto Window > Preferences > Java > Editor > Save Actions

然后转到窗口 > 首选项 > Java > 编辑器 > 保存操作

and configure your save actions.

并配置您的保存操作。

Along with saving, you can format, Organize imports,add modifier ‘final' where possible etc

除了保存之外,您还可以格式化、组织导入、在可能的情况下添加修饰符“最终”等

回答by Akitha_MJ

auto-alignment shortcut key Ctrl+Shift+F

自动对齐快捷键Ctrl+ Shift+F

to change the shortcut keys Goto Window > Preferences > Java > Editor > Save Actions

更改快捷键 Goto Window > Preferences > Java > Editor > Save Actions