It\'s been a while since I last used Eclipse. I used to love this handy key shortcut that added all the imports to the top of the source file, but I\'ve forgotten it. Does any
Ctrl + Shift + O (<-- an 'O' not a zero)
Note: This shortcut also removes unused imports.
Some other useful shortcuts:
Ctrl+Shift+ any key :Direct actions (on text mostly)
Alt+Shift+ any key : Indirect actions
Ctrl It was originally used to send Control character to terminals. Ctrl commands are commonly used shortcuts. (In Mac Command)
Alt It enables alternate uses for other keys.
The above shortcuts are default, if we want to change shortcuts we can do. In eclipse -> Windows -> preferences -> keys. Where we can find all shortcuts with full details:
and
https://shortcutworld.com/IntelliJ-IDEA/win/IntelliJ_Shortcuts
https://shortcutworld.com/Eclipse/win/Eclipse-Helios_Shortcuts
https://www.jetbrains.com/help/idea/migrating-from-eclipse-to-intellij-idea.html#Shortcuts
Yes. you can't remember all the shortcuts. You will forget many of them for sure. In this way, you can recall it and get the work done quickly.
Press Ctrl+3
And type whatever the hell you want :) It's a shortcut for shortcuts
For static import select the field and press Ctrl+Shift+M
IntelliJ just inserts them automagically; no shortcut required. If the class name is ambiguous, it'll show me the list of possibilities to choose from. It reads my mind....
Ctrl+Space : Show Imports
This displays imports as you're typing a non-standard class name provided the proper references have been added to the project.
This works on partial or complete class names as you are typing them or after the fact (Just place the cursor back on the class name with squigglies).