Skip to content
ioob.dev
Go back

IntelliJ IDEA: Frequently Used Shortcuts

· 6 min read
Table of contents

Table of contents

As a codebase grows, “knowing where things are” becomes just as important as “knowing what to write.”

ActionMacWindows / Linux
Search classcommand(⌘) OCtrl N
Search filecommand(⌘) shift(⇧) OCtrl Shift N
Search symbolcommand(⌘) option(⌥) OCtrl Alt Shift N
Search everywhereshift(⇧) twiceShift twice
Go to declarationcommand(⌘) BCtrl B
Go to implementationcommand(⌘) option(⌥) BCtrl Alt B
Go to super classcommand(⌘) UCtrl U
Find usagesoption(⌥) F7Alt F7
Go to linecontrol(⌃) GCtrl G
Navigate back / forwardcommand(⌘) [ / ]Ctrl Alt ← / →
Next / previous errorF2 / shift(⇧) F2F2 / Shift F2
Recent filescommand(⌘) ECtrl E
Recently edited locationscommand(⌘) shift(⇧) ECtrl 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

ActionMacWindows / Linux
Find in filecommand(⌘) FCtrl F
Replace in filecommand(⌘) RCtrl R
Find in projectcommand(⌘) shift(⇧) FCtrl Shift F
Replace in projectcommand(⌘) shift(⇧) RCtrl 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.

ActionMacWindows / Linux
Reformat codecommand(⌘) option(⌥) LCtrl Alt L
Optimize importscommand(⌘) option(⌥) OCtrl Alt O
Toggle line commentcommand(⌘) /Ctrl /
Toggle block commentcommand(⌘) option(⌥) /Ctrl Shift /
Expand / shrink selectionoption(⌥) ↑ / ↓Ctrl W / Ctrl Shift W
Duplicate linecommand(⌘) DCtrl D
Delete linecommand(⌘) BackspaceCtrl Y
Move line up / downcommand(⌘) shift(⇧) ↑ / ↓Shift Alt ↑ / ↓
Complete statementcommand(⌘) shift(⇧) EnterCtrl 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.

ActionMacWindows / Linux
Generate menu (constructor, getter, etc.)command(⌘) NAlt Insert
Surround with (try-catch, if, etc.)command(⌘) option(⌥) TCtrl Alt T
Implement interface methodscontrol(⌃) ICtrl I
Override parent methodscontrol(⌃) OCtrl O
Basic completioncontrol(⌃) SpaceCtrl Space
Smart completioncontrol(⌃) shift(⇧) SpaceCtrl Shift Space
Quick fix / intention actionoption(⌥) EnterAlt Enter
Parameter infocommand(⌘) PCtrl P
Quick documentationcommand(⌘) QCtrl Q
Quick definition previewcommand(⌘) shift(⇧) ICtrl 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.

ActionMacWindows / Linux
Renameshift(⇧) F6Shift F6
Change signaturecommand(⌘) F6Ctrl F6
Extract variablecommand(⌘) option(⌥) VCtrl Alt V
Extract methodcommand(⌘) option(⌥) MCtrl Alt M
Extract fieldcommand(⌘) option(⌥) FCtrl Alt F
Extract parametercommand(⌘) option(⌥) PCtrl Alt P
MoveF6F6
Refactoring menucommand(⌘) option(⌥) shift(⇧) TCtrl 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

ActionMacWindows / Linux
Runcontrol(⌃) RShift F10
Debugcontrol(⌃) DShift F9
Run current file / testcontrol(⌃) shift(⇧) RCtrl Shift F10
Toggle breakpointcommand(⌘) F8Ctrl F8
Step OverF8F8
Step IntoF7F7
Smart Step Intoshift(⇧) F7Shift F7
Step Outshift(⇧) F8Shift F8
Run to cursoroption(⌥) F9Alt F9
Stopcommand(⌘) F2Ctrl 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

ActionMacWindows / Linux
Commitcommand(⌘) KCtrl K
Pushcommand(⌘) shift(⇧) KCtrl Shift K
Update (Pull)command(⌘) TCtrl T
Rollback changescommand(⌘) option(⌥) ZCtrl Alt Z
VCS operations popupcontrol(⌃) VAlt `

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

ActionMacWindows / Linux
Toggle Project panelcommand(⌘) 1Alt 1
Toggle Git panelcommand(⌘) 9Alt 9
Maximize editorcommand(⌘) shift(⇧) F12Ctrl Shift F12
Close current tabcommand(⌘) WCtrl F4
Previous / next tabcommand(⌘) shift(⇧) [ / ]Alt ← / →
Find actioncommand(⌘) shift(⇧) ACtrl 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.


Related Posts

Share this post on:

Comments

Loading comments...


Previous Post
Design Patterns Part 8 — Singleton, Iterator, Prototype: Frequently Used but Often Misunderstood
Next Post
VS Code: Frequently Used Shortcuts