Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA - Remove empty line at End of File using hot keys

Am using IntelliJ IDEA Ultimate 2019.3 on macOS Catalina 10.15.4.

Trying to figure out how to NOT have an empty line when I conduct a cmdoptionl via the hot keys.

Unformatted:

Unformatted File


After conducting cmdoptionl, its still unformatted (lines 10 and 11 are still visible):

enter image description here


This is what I am seeking after issuing cmdoptionl:

enter image description here


As you can see, I do not want an empty line / newline inserted after the last closing } brace of a Java class.

like image 650
PacificNW_Lover Avatar asked Oct 28 '25 15:10

PacificNW_Lover


1 Answers

There is an option to enforce an empty line at the end of file, but there is no the opposite option at the moment.

If this option exists in any third-party formatters, you could try a plug-in or an external tool that will apply it (like Eclipse Code Formatter).

like image 87
CrazyCoder Avatar answered Oct 31 '25 11:10

CrazyCoder



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!