Is it possible to remove empty/blank lines using code formatting in Intellij IDEA?
标签:
intellij-idea
相关问题
- Configure gradle plugin based on future tasks
- How to make available “open this project in Intell
- IntelliJ 2017.1.2 GOLANG debug does not work on br
- JavaFX sample issue
- Could not import the newly generated play framewor
相关文章
- In IntelliJ IDEA, how can I create a key binding t
- IntelliJ IDEA can't open projects or add SDK o
- IntelliJ Subversion Authentication Required Dialog
- Kotlin Koans with EduTools plugin: “Failed to laun
- How to set up Intellij to run javap command on a p
- How to enable “type information” for streams retur
- How to add a project to build path in IntelliJ Ide
- How do I use Gradle bootRun with --args in Intelli
You can find and replace with regex option also
^(?:[\t ]*(?:\r?\n|\r))+
. It searches all empty lines in file. You need to just replace it with emptyFile >> Setting >> Editor >> Code style java >>Blank lines tab
You should change to 0 in code label(as picture), It would remove all unnecessary blank line when press format shortcut: ctrl + alt + L
Just in case it helps someone using newer versions of Intellij, in Intellij IDEA 2016.2.4 it is
File -> Other Settings -> Default Settings -> Editor -> Code Style -> Java(or Scala or whatever your language is) -> Blank Lines
Yes. It is possible to configure the number of blank lines in the settings menu (CTRL+ATL+S):
File -> Settings -> Editor -> Code Style -> Java(or Scala or whatever your language is) -> Blank Lines