Skip to content

IntelliJ IDEA

Comprehensive IntelliJ IDEA shortcuts and workflows for Java, Kotlin, and multi-language development.

General Shortcuts

Windows/LinuxmacOSDescription
Ctrl+Shift+ACmd+Shift+AFind Action
Double ShiftDouble ShiftSearch Everywhere
Ctrl+NCmd+OGo to Class
Ctrl+Shift+NCmd+Shift+OGo to File
Ctrl+Alt+Shift+NCmd+Option+OGo to Symbol
Ctrl+ECmd+ERecent Files
Ctrl+Shift+ECmd+Shift+ERecent Locations
Alt+F1Option+F1Select In
Ctrl+GCmd+LGo to Line
Ctrl+TabCtrl+TabSwitcher
Windows/LinuxmacOSDescription
Ctrl+BCmd+BGo to Declaration
Ctrl+Alt+BCmd+Option+BGo to Implementation
Ctrl+Shift+BCmd+Shift+BGo to Type Declaration
Ctrl+UCmd+UGo to Super Method
Alt+F7Option+F7Find Usages
Ctrl+F7Cmd+F7Find Usages in File
Ctrl+Shift+F7Cmd+Shift+F7Highlight Usages
Ctrl+Alt+F7Cmd+Option+F7Show Usages
Ctrl+HCmd+HType Hierarchy
Ctrl+Shift+HCmd+Shift+HMethod Hierarchy
Ctrl+Alt+HCtrl+Option+HCall Hierarchy

Editing

Windows/LinuxmacOSDescription
Ctrl+SpaceCtrl+SpaceBasic Code Completion
Ctrl+Shift+SpaceCtrl+Shift+SpaceSmart Code Completion
Ctrl+Alt+SpaceCtrl+Option+SpaceClass Name Completion
Ctrl+Shift+EnterCmd+Shift+EnterComplete Current Statement
Ctrl+PCmd+PParameter Info
Ctrl+QCtrl+JQuick Documentation
Shift+F1Shift+F1External Documentation
Ctrl+F1Cmd+F1Show Error Description
Alt+InsertCmd+NGenerate
Ctrl+OCtrl+OOverride Methods
Ctrl+ICtrl+IImplement Methods

Code Formatting

Windows/LinuxmacOSDescription
Ctrl+Alt+LCmd+Option+LReformat Code
Ctrl+Alt+OCtrl+Option+OOptimize Imports
Ctrl+Alt+ICtrl+Option+IAuto-Indent Lines
TabTabIndent Selection
Shift+TabShift+TabUnindent Selection
Ctrl+XCmd+XCut Current Line
Ctrl+CCmd+CCopy Current Line
Ctrl+DCmd+DDuplicate Line
Ctrl+YCmd+BackspaceDelete Line
Ctrl+Shift+JCtrl+Shift+JJoin Lines

Refactoring

Windows/LinuxmacOSDescription
F6F6Move
Shift+F6Shift+F6Rename
Ctrl+F6Cmd+F6Change Signature
Ctrl+Alt+NCmd+Option+NInline
Ctrl+Alt+MCmd+Option+MExtract Method
Ctrl+Alt+VCmd+Option+VExtract Variable
Ctrl+Alt+FCmd+Option+FExtract Field
Ctrl+Alt+CCmd+Option+CExtract Constant
Ctrl+Alt+PCmd+Option+PExtract Parameter
Ctrl+Shift+F6Cmd+Shift+F6Type Migration

Search and Replace

Windows/LinuxmacOSDescription
Ctrl+FCmd+FFind
F3Cmd+GFind Next
Shift+F3Cmd+Shift+GFind Previous
Ctrl+RCmd+RReplace
Ctrl+Shift+FCmd+Shift+FFind in Path
Ctrl+Shift+RCmd+Shift+RReplace in Path
Ctrl+F3Cmd+F3Find Word at Caret
F4F4Find Next Occurrence
Shift+F4Shift+F4Find Previous Occurrence

Running and Debugging

Windows/LinuxmacOSDescription
Shift+F10Ctrl+RRun
Shift+F9Ctrl+DDebug
Ctrl+Shift+F10Ctrl+Shift+RRun Context Configuration
Ctrl+Shift+F9Ctrl+Shift+DDebug Context Configuration
F8F8Step Over
F7F7Step Into
Shift+F7Shift+F7Smart Step Into
Shift+F8Shift+F8Step Out
Alt+F9Option+F9Run to Cursor
Alt+F8Option+F8Evaluate Expression
F9Cmd+Option+RResume Program
Ctrl+F8Cmd+F8Toggle Breakpoint

Version Control

Windows/LinuxmacOSDescription
Ctrl+KCmd+KCommit
Ctrl+Shift+KCmd+Shift+KPush
Ctrl+TCmd+TUpdate Project
Alt+Shift+COption+Shift+CView Recent Changes
Alt+9Cmd+9Version Control Tool Window
Ctrl+Alt+ZCmd+Option+ZRollback
Ctrl+Alt+ACmd+Option+AAdd to VCS

Live Templates

Common Java Templates

TemplateExpansion
psvmpublic static void main(String[] args)
soutSystem.out.println()
soufSystem.out.printf()
soutmSystem.out.println("methodName")
soutpSystem.out.println("parameterName = " + parameterName)
soutvSystem.out.println("variableName = " + variableName)
forifor (int i = 0; i < ; i++)
iterfor (Type item : collection)
itarfor (int i = 0; i < array.length; i++)
ritarfor (int i = array.length - 1; i >= 0; i--)

Common Kotlin Templates

TemplateExpansion
funfun functionName() {}
mainfun main(args: Array<String>) {}
printlnprintln()
forifor (i in 0 until )
forefor (item in collection)
ifnif (value != null)
innif (value == null)

Productivity Features

Code Generation

java
// Generate constructor
Alt+Insert → Constructor

// Generate getters/setters
Alt+Insert → Getter and Setter

// Generate toString()
Alt+Insert → toString()

// Generate equals() and hashCode()
Alt+Insert → equals() and hashCode()

// Generate test methods
Alt+Insert → Test

Postfix Completion

java
// Examples of postfix completion
list.for → for (String item : list)
condition.if → if (condition)
obj.null → if (obj == null)
obj.nn → if (obj != null)
obj.var → Type obj = 
obj.return → return obj;

Intentions and Quick Fixes

java
// Common intentions (Alt+Enter)
- Convert to lambda
- Add type annotation
- Create method from usage
- Implement interface
- Add import statement
- Surround with try-catch

Project Management

File and Project Operations

Windows/LinuxmacOSDescription
Ctrl+Alt+Shift+SCmd+;Project Structure
Ctrl+Alt+SCmd+,Settings
Ctrl+Shift+ACmd+Shift+AFind Action
Ctrl+Shift+F12Cmd+Shift+F12Toggle Maximized Editor
Alt+1Cmd+1Project Tool Window
Alt+7Cmd+7Structure Tool Window
Alt+9Cmd+9Version Control Tool Window
Alt+F12Option+F12Terminal

Build and Run

bash
# Maven projects
mvn clean compile
mvn test
mvn package
mvn install

# Gradle projects
./gradlew build
./gradlew test
./gradlew run
./gradlew clean

# SBT projects (Scala)
sbt compile
sbt test
sbt run

Best Practices

Code Quality

  • Use code inspections and analysis tools
  • Follow coding standards and conventions
  • Write comprehensive unit tests
  • Use meaningful variable and method names
  • Keep methods small and focused

Performance Optimization

  • Use appropriate data structures
  • Avoid premature optimization
  • Profile code to identify bottlenecks
  • Use lazy initialization when appropriate
  • Minimize object creation in loops

Debugging Strategies

  • Use conditional breakpoints
  • Evaluate expressions during debugging
  • Use logging for production debugging
  • Step through code systematically
  • Examine variable states and call stacks

Plugin Recommendations

  • SonarLint: Code quality analysis
  • CheckStyle: Code style checking
  • FindBugs: Bug pattern detection
  • Lombok: Reduce boilerplate code
  • Database Tools: Database integration
  • Docker: Container support
  • Kubernetes: Orchestration support