Install or upgrade IntelliJ IDEA
-
Download IntelliJ from https://www.jetbrains.com/idea/download/
-
Extract the downloaded file, e.g.
tar -xvf ideaIU-2024.3.tar.gz
-
Move the directory somewhere, e.g.
sudo mv idea-IU-243.21565.193/ /opt
-
Launch IntelliJ, e.g.
/opt/idea-IU-243.21565.193/bin/idea
-
Create or update desktop entry
Menu > Tools > Create Desktop Entry
-
If upgrading, remove old installation, e.g.
sudo rm -rf /opt/idea-IU-221.5080.210/
Keyboard shortcuts
-
File > Settings > Keymap
-
Override Find Next shortcut
Note: This will override the existing shortcut (Go to Line:Column)
-
Main Menu > Edit > Find > Find Next
-
Right-click > Add Keyboard Shortcut
-
Press Ctrl+G
-
OK > Remove
-
-
Override Replace shortcut
Note: This will override the existing shortcut (Type Hierarchy)
-
Main Menu > Edit > Find > Replace
-
Right-click > Add Keyboard Shortcut
-
Press Ctrl+H
-
OK > Remove
-
-
Create shortcuts for move line up/down
-
Main Menu > Code > Move Line Down
(There’s also Move Statement Down, but it works less predictably)
-
Right-click > Add Keyboard Shortcut
-
Press Alt+down arrow
-
OK > Remove
-
Main Menu > Code > Move Line Up
-
Right-click > Add Keyboard Shortcut
-
Press Alt+up arrow
-
OK > Remove
-
-
Enable auto format on save
-
IntelliJ
Automatically reformat code on save
-
File > Settings > Tools > Actions on Save
-
Enable any desired options, e.g.
- Reformat code
- Optimize imports
-
Disable formatting properties files
(It doesn’t seem to do anything except annoyingly remove blank lines, which can be useful to group properties)
Reformat code > All file types > uncheck Properties
-
-
Android Studio: Auto format code in Android Studio/Intellij IDEA
Enable automatic update when Gradle config is changed
-
File > Settings > Build, Execution, Deployment > Build Tools
-
Make sure Reload project after changes in the build scripts is checked
-
Select Any changes > OK
Disable spell checking
File > Settings > Editor > Inspections
- (Recommended) Uncheck Proofreading to turn off all proofreading
-
Or to disable spell checking:
Proofreading > under Proofreading uncheck Typo
Disable auto saving
ⓘ IntelliJ will auto save when you switch to another application, but this may trigger a lengthy rebuild in some projects and may be undesirable
-
File > Settings > Appearance & Behavior > System Settings
-
Uncheck Save files when switching to a different application or a built-in terminal
Lombok support
(Doesn’t apply to Android Studio) Follow the steps here: https://stackoverflow.com/questions/14866765/building-with-lomboks-slf4j-and-intellij-cannot-find-symbol-log