Tutorial :How can I indent a selected block of text in Eclipse 3.5.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.


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.


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


ctrl + i ---> it is for making accurate indentation to a block of source code.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »