views:

100

answers:

2

I use TAB and Shift-Tab in Visual Studio to indent an entire selection. This does nothing in Eclipse, and I can't seem to find another way to do it.

Update: I wasn't really paying all that much attention to this initially and did not ask the question correctly. I now realized that it is in XML files where TAB still does not indent a selection. I did not find a setting for this in the properties, so I assume it is not possible.

+2  A: 

Tab and Shift+Tab are the normal ways to do this in Eclipse, just like in Visual Studio.

In addition to the keyboard shortcuts, you can also do this from the Source menu. Source -> Shift Left, and Source -> Shift Right.

Have you checked to make sure tab/shift tabbing is working as you expect in other applications? Is there a stuck key on your keyboard preventing the shortcuts from working? Could another application be stealing the keyboard shortcuts? (as odd as that sounds...)

Also, try restarting Eclipse.

Joshua McKinnon
+1  A: 

Go to Window Menu -> Preferences -> Java -> Editor -> Typing and make sure the `'Tab key adjusts the indentation of the current line' checkbox is ticked.

Alb
It was ticked. This actually works today, without me changing anything (other than restarting Eclipse, which is why I accepted Joshua's answer).
cdonner