8

Is there a way to get a list of import suggestions in IntelliJ IDE? I'm looking for the equivalent of CTRL+SHIFT+O functionality from Eclipse, which automaticaly lists import suggestions.

Thanks!

mc110
  • 2,825
  • 5
  • 20
  • 21
Anton Belev
  • 11,963
  • 22
  • 70
  • 111

1 Answers1

8

On my current machine (on Windows), it's Ctrl-Alt-O, and the command is named "Optimize imports".

In general, in IntelliJ IDEA, you can use Ctrl-Shift-A and press part of a command to find it and know the appropriate shortcut. Typing Ctrl-Shift-A (or if you're on a Mac -Shift-A) and then search for "import" allows finding this command easily.

That said, it seems this command doesn't suggest imports like Eclipse does.

informatik01
  • 16,038
  • 10
  • 74
  • 104
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • Thanks, @JB Nizet! Just to add to the answer - after typing Ctrl-Alt-O I was promped to the different declarations that I was missing imports and for each of them I needed to type Alt+Enter in order to actually import them. Thanks again : ) – Anton Belev Jul 01 '14 at 16:05
  • Doesn't seem to be a way when there are multiple imports but you could take look at http://stackoverflow.com/questions/8608710/intellij-organize-imports for 'auto import' feature. – Ithar Dec 15 '15 at 16:44