I have alot of code that has white space to the left of the lines of code in my eclipse project. I would like to select pieces of this code and remove the extra white spacing so each line lines up with the left edge of the window.

有帮助吗?

解决方案

You can select the code you wish, and press SHIFT+TAB until the code lines up to the edge of the screen. You could also go to:

Window->Preferences->general->Editors->Text Editors

and when you're there, specify the tab width under:

Displayed Tab Width.

You can also customize Eclipses' formatter:

Go to:

Window->Preferences->Java->Code Style->Formatter

Select the formatter and press Edit. Edit it to your desire.

Then select the text you wish to format and press Ctrl+Shift+F

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top