Ankur Loriya
Ankur Loriya

Reputation: 3534

Remove unwanted blank line eclipse editor

When i open any file in eclipse. it show alternative blank line after all the code lines and blank line. how can i remove it....

enter image description here

Upvotes: 16

Views: 32258

Answers (6)

AlexD
AlexD

Reputation: 591

The good thing is that this is all well and good when you work alone;
The unfortunate side is that it also exposes "bad team cooperation" when you check in your files in the version control: there will be people who will gladly help you keep things consistent while there are many others who will ignore your pleas and keep overwriting your beautifully properly formatted code.

Upvotes: 0

Sun
Sun

Reputation: 3564

  1. Find and replace as Regular Expressions with ^\s*\n
  2. Press Ctrl + Shift + f
  3. Press Ctrt + Shift + o

Upvotes: 1

Nivir
Nivir

Reputation: 31218

In eclipse preference setting you can remove all the unwanted blank lines. Eclipse: Window > Preferences > Java > Code Style > Formatter > Edit the formatter and following screen will pop up. enter image description here

And when you format the code all unwanted blank lines will be removed.

Upvotes: 18

Kano
Kano

Reputation: 388

Maybe you didn't understand what Anshu said. Do a Ctr-F on your editor. In the options, select Regular Expression. Enter ^\s*\n for the Find expression. Keep the Replace box empty. Replace All!

This of course might lead to removal of unwanted lines as well.

Upvotes: 2

Mohd Kalimullah Sheikh
Mohd Kalimullah Sheikh

Reputation: 363

Due to your eclipse setting.

you can change your setting from preferences.

Upvotes: 1

Anshu
Anshu

Reputation: 7853

Find: ^\s*\n

Replace with: (empty)

Upvotes: 15

Related Questions