A collection of essential keyboard shortcuts (for Mac only for now) to boost your productivity in IntelliJ IDEA. I’ll keep this updated as I discover more useful shortcuts.
Editing #
⌃Space- Basic code completion⌥Enter- Show intention actions and quick-fixes
⌥⌘L- Reformat code⌘D- Duplicate current line or selection⌘⌫- Delete line at caret⌘/- Comment/uncomment with line comment⌥⌘/- Comment/uncomment with block commentShift + ↑/↓- Select multiple linesShift + Alt + ↑/↓- Move selected lines up/down⌃G- Add next occurrence⌃⌘G- Select all occurrences⌥↩(Enter)- open intention action menuAdd type annotation to function definitionChange access modifierOpen Github copilot inline chatAdd Scala Doc
Tab- Jump to the right past closing characters (when cursor is inside quotes, brackets, or braces)⌘ + →- Moves to the end of the line
Navigation #
⌘O- Go to class⇧⌘O- Go to file
F12- Jump to last tool windowEsc- Return to editor from tool window⌘L- Go to line⌘E- Recent files popup⌥F7- Find usages⌘B- Go to declaration
Search/Replace #
⇧⇧- Search everywhere (double-tap shift)⌘F- Find⌘R- Replace⇧⌘F- Find in path⇧⌘R- Replace in path
Refactoring #
⇧F6- Rename⌥⌘M- Extract method⌥⌘V- Extract variable⌥⌘F- Extract field⌥⌘C- Extract constant⌃⌥O- Optimize imports
Running & Debugging #
⌃R- Run⌃D- DebugF8- Step overF7- Step into⌥⌘R- Resume program⌘F8- Toggle breakpoint⇧⌘F8- View breakpoints
Windows Management #
⌘1, ⌘2...- Open corresponding tool window⌃Tab- Switch between tabs and tool windows⇧⌘'- Maximize/restore editor⌘[- Navigate back⌘]- Navigate forward
Productivity Boosters #
⌃⌥H- Call hierarchy⌘F12- File structure popup⌘7- To open File Structure side window