[ACCEPTED]-Remove blank line in Eclipse-eclipse
Find: ^\s*\n
Replace with: (empty)
0
sry this might be an different answer but 6 you can set the number of blank lines you 5 wish to have after fields, methods and blocks 4 in the formatting dialog of the eclipse 3 preferences. then you can hit ctrl-shift-f 2 to automatically format your code depending 1 on your custom definitions.
have fun!
- for the find/replace operation, "\n\r\s" regex will work on windows, for unix based system, "\n\s" can be used
- as already suggested, you can format your code by Ctl+Shift+F
- for manual work, locate a blank line and press Ctl+D (Cmd+D on Mac) <- gives u satisfaction of killing the line with your own bare hands :)
cheer!
0
I was suprised that for XML files edited 5 with Eclipse there is a good solution:
Select 4 the checkbox value named 'Clear all blank 3 lines' in Formatting panel Window->Preferences->XML->XML 2 Files-> Editor
Save and use the "Ctrl+Shift+F' shortcut
The 1 blank lines will dissappear!
This one worked for me for years:
Replace 1 this: [\t ]+$
With nothing
Hope this helps!
Many thanks to lamamac.
In genereal, when 3 you want to do search replace with regular 2 expressions in eclipse the $ sign doesn't 1 work as it should.
Use '\s*\n
' instead of '$
'
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.