IntelliJ Idea 12: How to automatically import namespaces?

In Eclipse, I can press the shortcut Ctrl + Shift + O to automatically import namespaces. How to do this in IntelliJ IDEA Community Edition?

+36
intellij-idea
Dec 25 '12 at 17:29
source share
4 answers

Code > Optimize Imports will provide you with the following behavior. If you want to configure the settings, you can do this through Settings > Editor > Auto Import .

enter image description here

+22
Dec 25 '12 at 17:32
source share

You can type Alt Enter to display a drop-down list of possible classes for automatic import, it is similar to Eclipse.

I found this in Android Studio on Mac OS X - if I am above a class name that it cannot find, you will get a tooltip showing this shortcut

+5
Jan 29 '15 at 19:53
source share

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

+1
Mar 10 '14 at 9:25
source share

IntelliJ ShortCut depends on the Keymap:

enter image description here

You can customize the shortcut for your favorite teams.

0
Apr 03 '17 at 17:08 on
source share



All Articles