Table of contents
- Navigation
- Search & Replace
- Editing
- Code Generation & Completion
- Refactoring
- Run & Debug
- Git / VCS
- Window & Tab Management
Navigation
As a codebase grows, “knowing where things are” becomes just as important as “knowing what to write.”
| Action | Mac | Windows / Linux |
|---|---|---|
| Search class | command(⌘) O | Ctrl N |
| Search file | command(⌘) shift(⇧) O | Ctrl Shift N |
| Search symbol | command(⌘) option(⌥) O | Ctrl Alt Shift N |
| Search everywhere | shift(⇧) twice | Shift twice |
| Go to declaration | command(⌘) B | Ctrl B |
| Go to implementation | command(⌘) option(⌥) B | Ctrl Alt B |
| Go to super class | command(⌘) U | Ctrl U |
| Find usages | option(⌥) F7 | Alt F7 |
| Go to line | control(⌃) G | Ctrl G |
| Navigate back / forward | command(⌘) [ / ] | Ctrl Alt ← / → |
| Next / previous error | F2 / shift(⇧) F2 | F2 / Shift F2 |
| Recent files | command(⌘) E | Ctrl E |
| Recently edited locations | command(⌘) shift(⇧) E | Ctrl Shift E |
Double Shift is the most versatile. Classes, files, symbols, settings, actions — everything is searchable from here. When you’re not sure what to press, just hit Shift twice.
The difference between command(⌘) B and command(⌘) option(⌥) B is important. Pressing command(⌘) B on an interface method takes you to the interface declaration, while command(⌘) option(⌥) B shows a list of actual implementations. In projects that rely on interface-based design like Spring, knowing this distinction alone makes a noticeable difference in navigation speed.
command(⌘) E shows recently opened files, while command(⌘) shift(⇧) E takes you back to the exact location you edited. When you’re reviewing code and need to return to the spot you just changed, command(⌘) shift(⇧) E is the precise choice.
Search & Replace
| Action | Mac | Windows / Linux |
|---|---|---|
| Find in file | command(⌘) F | Ctrl F |
| Replace in file | command(⌘) R | Ctrl R |
| Find in project | command(⌘) shift(⇧) F | Ctrl Shift F |
| Replace in project | command(⌘) shift(⇧) R | Ctrl Shift R |
In the project-wide search (command(⌘) shift(⇧) F), you can set scope filters — entire project, specific module, or a particular directory. Narrowing the scope reduces noise. Regex is also supported, so pattern-based replacements can be done without extra tools.
For replace (command(⌘) R, command(⌘) shift(⇧) R), you can review matches one by one or replace all at once. Building the habit of checking the preview for unintended matches before clicking “Replace All” helps prevent accidents.
Editing
These are the actions you repeat most often when writing code. Once these shortcuts become second nature, your typing rhythm noticeably speeds up.
| Action | Mac | Windows / Linux |
|---|---|---|
| Reformat code | command(⌘) option(⌥) L | Ctrl Alt L |
| Optimize imports | command(⌘) option(⌥) O | Ctrl Alt O |
| Toggle line comment | command(⌘) / | Ctrl / |
| Toggle block comment | command(⌘) option(⌥) / | Ctrl Shift / |
| Expand / shrink selection | option(⌥) ↑ / ↓ | Ctrl W / Ctrl Shift W |
| Duplicate line | command(⌘) D | Ctrl D |
| Delete line | command(⌘) Backspace | Ctrl Y |
| Move line up / down | command(⌘) shift(⇧) ↑ / ↓ | Shift Alt ↑ / ↓ |
| Complete statement | command(⌘) shift(⇧) Enter | Ctrl Shift Enter |
option(⌥) ↑ (Expand Selection) is one of those features you can’t let go of once you know it. Place the cursor on a variable and press once to select the variable name, press again to select the entire expression, again for the whole line, and again for the entire block. It’s more precise and faster than mouse dragging.
command(⌘) shift(⇧) Enter is an underrated shortcut. Type if and press it — the parentheses and curly braces are automatically closed. Type a method signature and press it — the body block opens. A small combo, but it noticeably reduces typing.
Code Generation & Completion
This is where IntelliJ most clearly differentiates itself from text editors. The IDE writes repetitive boilerplate for you.
| Action | Mac | Windows / Linux |
|---|---|---|
| Generate menu (constructor, getter, etc.) | command(⌘) N | Alt Insert |
| Surround with (try-catch, if, etc.) | command(⌘) option(⌥) T | Ctrl Alt T |
| Implement interface methods | control(⌃) I | Ctrl I |
| Override parent methods | control(⌃) O | Ctrl O |
| Basic completion | control(⌃) Space | Ctrl Space |
| Smart completion | control(⌃) shift(⇧) Space | Ctrl Shift Space |
| Quick fix / intention action | option(⌥) Enter | Alt Enter |
| Parameter info | command(⌘) P | Ctrl P |
| Quick documentation | command(⌘) Q | Ctrl Q |
| Quick definition preview | command(⌘) shift(⇧) I | Ctrl Shift I |
option(⌥) Enter is the key you’ll press most in IntelliJ. On errors, it shows fix suggestions; on valid code, it offers refactoring options. When you’re unsure what to do with the cursor positioned somewhere, pressing option(⌥) Enter shows you what IntelliJ can do.
The difference between control(⌃) Space (basic) and control(⌃) shift(⇧) Space (smart) is also worth knowing. Basic completion lists candidates by name, while smart completion analyzes the types in the current context and filters to matching candidates only. When you only want to see variables or methods whose return type matches, control(⌃) shift(⇧) Space is the way to go.
Refactoring
In a text editor, renaming means running a global find-and-replace, risking accidental changes to string literals. IntelliJ understands the semantics of your code and renames accordingly, eliminating such problems.
| Action | Mac | Windows / Linux |
|---|---|---|
| Rename | shift(⇧) F6 | Shift F6 |
| Change signature | command(⌘) F6 | Ctrl F6 |
| Extract variable | command(⌘) option(⌥) V | Ctrl Alt V |
| Extract method | command(⌘) option(⌥) M | Ctrl Alt M |
| Extract field | command(⌘) option(⌥) F | Ctrl Alt F |
| Extract parameter | command(⌘) option(⌥) P | Ctrl Alt P |
| Move | F6 | F6 |
| Refactoring menu | command(⌘) option(⌥) shift(⇧) T | Ctrl Alt Shift T |
shift(⇧) F6 (Rename) is the safest and most frequently used refactoring. It renames variables, methods, classes, and even file names all at once, updating every reference across the codebase.
command(⌘) option(⌥) M (Extract Method) and command(⌘) option(⌥) V (Extract Variable) are essential for cleaning up code. Select a block in a long method and press command(⌘) option(⌥) M — that block becomes a new method, leaving a call in its place. Apply command(⌘) option(⌥) V to a complex expression, and it gets a meaningful name that improves readability.
Run & Debug
| Action | Mac | Windows / Linux |
|---|---|---|
| Run | control(⌃) R | Shift F10 |
| Debug | control(⌃) D | Shift F9 |
| Run current file / test | control(⌃) shift(⇧) R | Ctrl Shift F10 |
| Toggle breakpoint | command(⌘) F8 | Ctrl F8 |
| Step Over | F8 | F8 |
| Step Into | F7 | F7 |
| Smart Step Into | shift(⇧) F7 | Shift F7 |
| Step Out | shift(⇧) F8 | Shift F8 |
| Run to cursor | option(⌥) F9 | Alt F9 |
| Stop | command(⌘) F2 | Ctrl F2 |
The most useful debugging shortcut is option(⌥) F9 (Run to Cursor). Instead of setting multiple breakpoints, place the cursor on the line you want to inspect and press option(⌥) F9 — execution stops right there. No more creating and deleting temporary breakpoints.
shift(⇧) F7 (Smart Step Into) is for when a single line has multiple method calls. Regular F7 steps into the first call immediately, but shift(⇧) F7 lets you choose which method to enter.
Git / VCS
| Action | Mac | Windows / Linux |
|---|---|---|
| Commit | command(⌘) K | Ctrl K |
| Push | command(⌘) shift(⇧) K | Ctrl Shift K |
| Update (Pull) | command(⌘) T | Ctrl T |
| Rollback changes | command(⌘) option(⌥) Z | Ctrl Alt Z |
| VCS operations popup | control(⌃) V | Alt ` |
command(⌘) K → write commit message → command(⌘) shift(⇧) K to push. Once this flow becomes muscle memory, you’ll rarely need to open the terminal. command(⌘) option(⌥) Z (Rollback) can revert changes file by file, making it a handy alternative to git checkout.
control(⌃) V (VCS popup) is a menu that provides access to Git operations like branch creation, merge, and stash all in one place. You don’t need to memorize individual shortcuts — just find what you need here.
Window & Tab Management
| Action | Mac | Windows / Linux |
|---|---|---|
| Toggle Project panel | command(⌘) 1 | Alt 1 |
| Toggle Git panel | command(⌘) 9 | Alt 9 |
| Maximize editor | command(⌘) shift(⇧) F12 | Ctrl Shift F12 |
| Close current tab | command(⌘) W | Ctrl F4 |
| Previous / next tab | command(⌘) shift(⇧) [ / ] | Alt ← / → |
| Find action | command(⌘) shift(⇧) A | Ctrl Shift A |
command(⌘) shift(⇧) F12 maximizes the editor area. The sidebar and bottom panel all disappear, leaving only the code. Useful when you need to focus on reading or writing, and pressing it again restores the original layout.
command(⌘) shift(⇧) A (Find Action) is the shortcut for when you don’t know the shortcut. Search for a feature name in English, and it shows both the feature and its assigned shortcut. Using it regularly helps you naturally memorize shortcuts over time.
Nobody memorizes all shortcuts at once. Start by picking the one mouse action you repeat most and replacing it with a shortcut. At one per week, your hands will be moving on their own within a month. If you can’t remember a shortcut, open command(⌘) shift(⇧) A (Find Action) and search by feature name — the shortcut will be displayed alongside it.


Loading comments...