36
votes

In Eclipse, I can hit the Ctrl+Shift+O shortcut to auto import namespaces. How do I do it in IntelliJ IDEA Community Edition?

4
Gist of shortcuts IntelliJ IDEA and Eclipse Shortcuts ctrl+alt+oAbhijeet

4 Answers

22
votes

Code > Optimize Imports will provide you the behavior you are after. If you want to adjust the settings you can so via Settings > Editor > Auto Import.

enter image description here

6
votes

You can type AltEnter to show a dropdown of possible classes to auto-import, it's similar to Eclipse.

I found this in Android Studio on Mac OS X - if I mouse over the class name it can't find, you get a suggestion pop-up that shows this shortcut

1
votes

You can try this: "Ctrl+Alt+O" . enter image description here

0
votes

IntelliJ ShortCut depends on Keymap:

enter image description here

You can customize shortcut for your favorite commands.