Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I indent a selected block of text in Eclipse 3.5.2?

Tags:

eclipse

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.

like image 505
cdonner Avatar asked May 20 '10 02:05

cdonner


2 Answers

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.

like image 157
Joshua McKinnon Avatar answered Sep 20 '22 12:09

Joshua McKinnon


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

like image 22
justGuest Avatar answered Sep 22 '22 12:09

justGuest