Skip to content
← All insights
Developer tools12 min read

IntelliJ IDEA shortcuts: the commands that keep code moving

A practical guide to the IntelliJ IDEA shortcuts that matter most for navigating a codebase, editing safely, refactoring, searching, debugging and staying in flow.

Learn movement before memorising menus

The useful IntelliJ shortcuts reduce the distance between a question and its answer: where is this symbol defined, who calls it, which implementation runs, what changed in this file and why is this test failing?

Shortcuts differ between macOS, Windows and Linux. The commands in this article use the default macOS keymap; IntelliJ shows the matching shortcut in menus and lets you search or customise it in Settings under Keymap.

Do not try to learn everything in one week. Pick the command that replaces your most repeated mouse action, use it until it becomes automatic, then add the next one.

Find anything before browsing folders

Double Shift opens Search Everywhere. Use it for files, classes, symbols, actions and settings when you know the name but not the location. It is often faster than expanding a project tree in an unfamiliar repository.

Use Go to File for a filename and Go to Class or Go to Symbol when you know the code name. Recent Files is particularly useful when moving between a small set of related implementation and test files.

Search should narrow a question, not become a substitute for understanding structure. Once you find a relevant entry point, follow usages and call hierarchy to discover how behaviour is connected.

High-value navigation shortcuts on macOStext
Shift Shift       Search Everywhere
Cmd Shift O       Go to File
Cmd O             Go to Class
Cmd Option O      Go to Symbol
Cmd E             Recent Files
Cmd B             Go to Declaration
Cmd Option B      Go to Implementation
Option F7         Find Usages
Cmd Option H      Call Hierarchy

Navigate code by meaning, not only by line number

Go to Declaration follows a reference to where it is defined. Go to Implementation is useful for interfaces, traits and abstract classes where the definition itself is only a contract. Find Usages answers the inverse question: who depends on this symbol?

The type hierarchy and call hierarchy are valuable when a change has non-obvious effects. They expose inheritance and calling relationships without requiring broad text searches that may include comments, examples and unrelated names.

Use the navigation history commands to return after following several definitions. This makes exploration reversible and avoids repeatedly rebuilding the route through a codebase.

Make small edits quickly, then let the IDE check them

Duplicate Line, Delete Line and Move Line are simple commands that avoid selecting text precisely. Expand Selection grows a selection through meaningful syntax units: expression, statement, block and method. It is safer than dragging across nested punctuation.

Complete Statement adds missing punctuation or braces where IntelliJ can infer the intended structure. Basic completion suggests names and members; smart completion narrows suggestions to values that fit the expected type.

Formatting is not a substitute for review, but it removes low-value diff noise. Format the changed code with the project’s agreed style, then inspect the diff rather than assuming the automated change is harmless.

Editing shortcuts on macOStext
Cmd D             Duplicate line or selection
Cmd Y             Delete line
Option Up/Down    Move line or selection
Option Up         Expand selection
Option Down       Shrink selection
Cmd Shift Enter   Complete current statement
Cmd Space         Basic completion
Cmd Shift Space   Smart completion
Cmd Option L      Reformat code

Use refactorings for semantic changes

Rename is not merely a faster text replacement. IntelliJ understands declarations and usages, so it can rename a method, class, variable or file without changing unrelated prose or similarly named symbols.

Extract Method, Extract Variable and Change Signature can make a small design improvement while preserving references across the project. Review the generated diff and run relevant tests: an IDE can update syntax accurately without proving that the new boundary is a good one.

Keep refactorings separate from behaviour changes where practical. A review is easier when it can distinguish a deliberate behavioural decision from a mechanical rename or movement of code.

Refactoring shortcuts on macOStext
Ctrl T           Refactor This menu
Shift F6          Rename
Cmd Option M      Extract Method
Cmd Option V      Extract Variable
Cmd F6            Change Signature
Cmd N             Generate code

Search text with a clear scope

Find in Files searches project text and is appropriate for literals, configuration keys, error messages and comments. Use a scope deliberately: a whole repository search can include generated files, dependencies and build output that obscure the result.

Replace in Files deserves more caution. Preview replacements, restrict the scope and use version control to inspect the diff. A large mechanical rewrite is still a change that needs review.

Structural Search can find syntax-shaped patterns that ordinary text search cannot distinguish, but it is most useful after the simpler navigation and usage tools have failed to answer the question.

Text search shortcuts on macOStext
Cmd F             Find in current file
Cmd R             Replace in current file
Cmd Shift F       Find in Files
Cmd Shift R       Replace in Files
Cmd G             Find next
Cmd Shift G       Find previous

Run the narrowest useful check

Run a focused test or configuration while changing one behaviour, then run the wider suite when the change is ready. IntelliJ can run a test class, one test method or a selected run configuration without making the developer leave the current context.

The Run tool window is useful for output, but a green local test is only one piece of evidence. Important changes still need the same build, integration and CI checks that the repository expects.

Learn the rerun and debug commands together. The useful cycle is small: reproduce, inspect, change, rerun and only then widen the evidence.

Run and debug shortcuts on macOStext
Ctrl R           Run current configuration
Ctrl D           Debug current configuration
Cmd F2           Stop
Cmd F8           Toggle breakpoint
F8               Step over
F7               Step into
Shift F8         Step out
Option F8        Evaluate expression

Debug with a question in mind

A debugger is most effective when it answers a specific question: which branch was taken, why is this value null, which response did the integration return or where did a state transition first become invalid?

Set breakpoints near the boundary where the expected and actual behaviour diverge. Inspect variables and evaluate expressions, but avoid changing production-like state casually while paused; a debugger can create a path that the real application never takes.

For concurrent or timing-sensitive problems, logs, traces and metrics may provide truer evidence than stopping one thread. Choose the observation tool that least changes the behaviour you are trying to understand.

Keep version control visible

Use IntelliJ’s Git integration to inspect changed files, compare a diff, stage intentionally and resolve straightforward conflicts. The IDE is especially useful for seeing intra-line changes and navigating from a diff to the surrounding code.

A clean diff is part of an engineering handover. Before committing, remove accidental formatting changes, generated files and unrelated edits. Write a commit that represents one reviewable decision rather than every experiment from the day.

The command line remains valuable for repository operations and automation. The aim is not to avoid it, but to use the interface that makes the current decision easiest to understand.

  • Use Search Everywhere before hunting through folders
  • Use Go to Declaration, Implementation and Usages to trace behaviour
  • Use Rename and Extract refactorings instead of broad text replacement
  • Run the smallest relevant test before a wider suite
  • Inspect the Git diff before committing
  • Customise a shortcut only after the default command is familiar