Accepted answer

in my copy, shift + tab does this, as long as i have a code selection, and am in a code window.


i'd rather go to menu source em click on "cleanup document"


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.


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);


tab to indent right by four characters


on mac (on french keyboard its) cmd + shift + f


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"


for left indent shift + tab

for right indent simple tab


in any version of eclipse ide for source code indentation.

select the source code and use the following keys

  1. for default java indentation ctrl + i

  2. for right indentation tab

  3. for left indentation shift + tab


control + shift + f will do the work


i thought it was shift + tab.


you can use ctrl + shift + f which will run your formatter on the file and fix indentations along the way also.


ctrl + i (indentation). see at search for indentation.

Related Query

More Query from same tag