IntelliJ IDEA Quick Guide
IntelliJ IDEA macOS Shortcut List
| Shortcut | Description |
|---|---|
| Command + Option + L | Reformat code. Neatly aligns source-code indentation and tabs. |
| Command + delete | Deletes the line containing the cursor. |
| Command + D | Duplicates the line containing the cursor. |
| Command + B | Navigates to the source referenced at the cursor. |
| Command + Option + B | When the cursor is on a Java interface method, navigates to its implementation. You can also use “Right-click > Go to > Implementation”. |
| Control + Option + O | Removes unused imports. |
| Command + Shift + U | Changes letter case. |
| Command + Shift + 8 | Toggles multiple cursors. This is useful when editing several lines at once. |
Viewing Korean Text in IntelliJ IDEA properties Files
In Eclipse, you had to install a separate Properties plugin to view multilingual text in properties files. In IntelliJ IDEA, you can view multilingual text with a simple setting.
- Go to
[Preferences]-[Editor]-[File Encodings]. - Select Transparent native-to-ascii conversion.
- Click Apply.
Automatically Adding Java Imports in IntelliJ IDEA
To configure IntelliJ IDEA to add imports automatically:
- Go to
[Preferences]-[Editor]-[General]-[Auto import]. - Select Add unambiguous imports on the fly.
- Click Apply.
Automatically Removing Unused Java Imports in IntelliJ IDEA
To configure IntelliJ IDEA to remove unused Java imports automatically:
- Go to
[Preferences]-[Editor]-[General]-[Auto import]. - Select Optimize imports on the fly.
- Click Apply.
When Compilation Errors Do Not Disappear in IntelliJ IDEA
Sometimes a compilation error occurs because IntelliJ IDEA cannot import or find another class.
- Click
[File]-[Invalidate Caches]. - Click Invalidate and Restart.
Configuring the Project Java Version in IntelliJ IDEA
JDK settings:
- Click
[File]-[Project Structure]-[Project]. - Set the Java version in Project SDK.
Gradle JRE settings:
- Click
[Preferences]-[Build, Execution, Deployment]-[Build Tools]-[Gradle]. - Set the Java version as the JRE under “Build and run”.
DataGrip Shortcuts
| Shortcut | Description |
|---|---|
| Command + Shift + U | Converts text to uppercase. |
| Command + Option + L | Neatly aligns SQL-code indentation and tabs. |