Eclipse keyboard shortcut to indent source code to the left?

与世无争的帅哥 提交于 2019-11-29 20:01:06
jwismar

In my copy, Shift + Tab does this, as long as I have a code selection, and am in a code window.

Oren Nitzan

Ctrl + I (indentation). See at http://www.rossenstoyanchev.org/write/prog/eclipse/eclipse3.html Search for Indentation.

You can use Ctrl + Shift + F which will run your formatter on the file and fix indentations along the way also.

CookieOfFortune

I thought it was Shift + Tab.

Raghu

control + shift + F will do the work

jjisnow

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

Swap-IOS-Android

On Mac (on french keyboard its) cmd + shift + F

i'd rather go to menu source em click on "Cleanup Document"

Vishnu Prasanth G

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!