So I've recently moved from Eclipse to IntelliJ IDEA (Ultimate Edition) and I'm feeling fussy about whitespace.
At the moment I've set IntelliJ IDEA to show me whitespace, and it looks like this:
Eclipse would show the same code block like this:
Is there anyway I can make IntelliJ IDEA only show trailing whitespace, just like Eclipse can?
To enable this feature in IntelliJ, you must open the Settings dialog ( Ctrl+Alt+S ) and navigate to the Editor | General | Appearance tab. In this tab you need to enable the Show whitespace option. In addition, you can individually enable/disable which whitespaces to show: leading, trailing or inner.
Tweak: Auto-remove trailing spaces Go to Settings . On the left side of the dialog, click on Editor -> General . On the right side, scroll to the On Save section. Change Remove trailing spaces on: to Modified lines .
Trailing whitespace. Description: Used when there is whitespace between the end of a line and the newline.
Hover the mouse on warning in VS Code or any IDE and use quick fix to remove white spaces. Press f1 then type trim trailing whitespace .
Most recent IntelliJ IDEA versions do support showing only trailing whitespaces:
Original answer from 2013:
IDEA has no this feature, but you can enable an option to strip trailing whitespace on all lines automatically and forget about this problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With