Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse text formatter

Tags:

eclipse

I have written some code in eclipse which has a lot of blank lines. I need to format the code and remove the blank lines. How do I go about this?

like image 810
mdv Avatar asked Dec 05 '25 07:12

mdv


1 Answers

You can use the default text formatter by selecting the code you want to format and then typing:

Ctrl + Shift + F (Contextual menu Source -> Format)

If this doesn't work you can edit this default formatter by changing the Existing blank lines - Number of empty lines to preserve from 1 to your number in Prefrences Java Code Style Formatter Edit Eclipse default formater Blank line tab.

like image 116
Manuel Selva Avatar answered Dec 07 '25 23:12

Manuel Selva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!