开发者

remove indentation in source code

开发者 https://www.devze.com 2023-03-12 23:05 出处:网络
I use Eclipse IDE and Window Builder Pro for create window. When I go to the source code I se开发者_开发百科e a big indent text. How to delete ?

I use Eclipse IDE and Window Builder Pro for create window. When I go to the source code I se开发者_开发百科e a big indent text. How to delete ?

remove indentation in source code


How about good old Shift + Tab?


If by "how to delete" you mean to say that you want to decrease the indentation level, try this:

Go to

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

There specify the indentation level under :

Displayed Tab Width.

Additionally you can customize you formatting in Eclipse as :

Go to

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

Select the formatter and press Edit. Use whatever suits you.

Then Select the text you want to format and press Ctrl+Shift+F


If you want to fix indent only you can select lines and press Ctrl-I. Take a look at Eclipse keys


Most likely you insert tab character which is being expanded to 8 positions in target IDE. Change setting in Eclipse to insert 4 spaces (or whatever your style is) when tab is pressed. Then you can try to reformat your file in Eclipse. Also, you can use sed to replace \t with 4 spaces.


If you like the way your formatter is set up for the rest of your code, perhaps telling the formatter not to work on this section would be desirable. Then you can unindent the section to make it visually appealing and not worry about it changing formatting.

Linked solution works in Eclipse 3.6.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号