问题
I've looked in the keyboard shortcuts list in Eclipse but can't find keyboard shortcut to indent source code to the left. Surely there is one?
回答1:
In my copy, Shift + Tab does this, as long as I have a code selection, and am in a code window.
回答2:
Ctrl + I (indentation). See at http://www.rossenstoyanchev.org/write/prog/eclipse/eclipse3.html Search for Indentation.
回答3:
You can use Ctrl + Shift + F which will run your formatter on the file and fix indentations along the way also.
回答4:
I thought it was Shift + Tab.
回答5:
control + shift + F will do the work
回答6:
For Left indent
Shift + Tab
For Right indent
simple Tab
回答7:
Obviously this is only for Pydev, but I've worked out that you can get the very useful functions "Shift Right" and "Shift Left" (mapped by default to CTRL+ALT+. and CTRL+ALT+,) to become useful by changing their keybindings to "Pydev Editor Scope" from "Pydev View"
回答8:
In any version of Eclipse IDE for source code indentation.
Select the source code and use the following keys
For default java indentation Ctrl + I
For right indentation Tab
For left indentation Shift + Tab
回答9:
On Mac (on french keyboard its) cmd + shift + F
回答10:
i'd rather go to menu source em click on "Cleanup Document"
回答11:
For Mac Users who using Eclipse Use Cmd + I(Indent) and Cmd + F(Format). But I had worst experience with Cmd + F which breaks the code in to several lines as follows
String A = MyClass.getA(x, y);
if (A != null) {
A = Long.parseLong(0);
}
Where my original code is as follows
String A = MyClass.get(x, y);
if (A != null) {
A = Long.parseLong(0);
}
回答12:
Tab to indent right by four characters
回答13:
for me the default is Shift + Tab,
you can select the text you want, press Shift + Tab to shift everything on the left, selecting all and pressing Tab shifts everything to the right.
来源:https://stackoverflow.com/questions/3526771/eclipse-keyboard-shortcut-to-indent-source-code-to-the-left