In Eclipse, I can hit the Ctrl+Shift+O shortcut to auto import namespaces. How do I do it in IntelliJ IDEA Community Edition?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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
.
回答2:
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
回答3:
You can try this: "Ctrl+Alt+O
" .
回答4:
IntelliJ ShortCut depends on Keymap:
You can customize shortcut for your favorite commands.
标签:
intellij-idea