Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show only trailing whitespace in IntelliJ Idea

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: IntelliJ IDEA whitespace

Eclipse would show the same code block like this: Eclipse whitespace

Is there anyway I can make IntelliJ IDEA only show trailing whitespace, just like Eclipse can?

like image 814
Kezz Avatar asked Jul 11 '13 15:07

Kezz


People also ask

How do I show whitespace characters in IntelliJ?

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.

How do I get rid of unwanted spaces in IntelliJ?

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 .

What is trailing whitespace?

Trailing whitespace. Description: Used when there is whitespace between the end of a line and the newline.

How do you solve trailing whitespace?

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 .


1 Answers

Most recent IntelliJ IDEA versions do support showing only trailing whitespaces:

trailing

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.

like image 137
CrazyCoder Avatar answered Nov 15 '22 21:11

CrazyCoder