3

I manage to organize my imports like this

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;

with this setting:

https://i.stack.imgur.com/tqKaE.png

How do I organize them like this (blank between each different package group) ?

import javax.servlet.http.HttpServletResponse;
import java.io.File;

import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
WannaBeCoder
  • 1,280
  • 2
  • 17
  • 40
Dag Heyman
  • 191
  • 1
  • 9
  • have you tried `Ctrl + Alt + O` . This is for `organize import` in intelliJ – Adi Dec 12 '14 at 10:35
  • 1
    @Adi Yes, that is not the problem, it's about >>how<< IntellIj organizes the imports. It's about using the same settings as Eclipse users an avoiding unnecessary diffs. – Dag Heyman Dec 12 '14 at 15:58

1 Answers1

0

Go to Settings/Editor/Code Style/Java and click on the Imports tab.

In the bottom half of the screen you can arrange the layout, including adding blank lines, separating static imports etc

Kate
  • 109
  • 2
  • 4
  • 1
    I don't see an option to add blank lines between all top-level packages. Only a way to explicitly add blank lines between specific packages. – Doradus Feb 10 '21 at 13:39