Skip to the content.

Essential IntelliJ IDEA Shortcuts

IntelliJ IDEA is a powerful IDE, and knowing its keyboard shortcuts can significantly boost your productivity. This page provides a curated list of some of the most common and useful shortcuts for editing, navigation, refactoring, and more.

General

Action Windows/Linux macOS
Search Everywhere Double Shift Double Shift
Find Action Ctrl+Shift+A Cmd+Shift+A
Show Context Actions Alt+Enter Option+Enter
View Recent Files Ctrl+E Cmd+E
Reformat Code Ctrl+Alt+L Cmd+Option+L
Open Settings Ctrl+Alt+S Cmd+,
Toggle Project View Alt+1 Cmd+1
Focus Editor Esc Esc
Hide All Tool Windows Ctrl+Shift+F12 Cmd+Shift+F12

Editing

Action Windows/Linux macOS
Basic Code Completion Ctrl+Space Ctrl+Space
Smart Code Completion Ctrl+Shift+Space Ctrl+Shift+Space
Complete Statement Ctrl+Shift+Enter Cmd+Shift+Enter
Duplicate Line/Block Ctrl+D Cmd+D
Delete Line Ctrl+Y Cmd+Backspace
Comment/Uncomment Line Ctrl+/ Cmd+/
Comment/Uncomment Block Ctrl+Shift+/ Cmd+Option+/
Extend Selection Ctrl+W Option+Up
Shrink Selection Ctrl+Shift+W Option+Down
Generate Code Alt+Insert Cmd+N
Optimize Imports Ctrl+Alt+O Ctrl+Option+O
Move Line Up/Down Alt+Shift+Up/Down Option+Shift+Up/Down
Action Windows/Linux macOS
Go to Declaration Ctrl+B or Ctrl+Click Cmd+B or Cmd+Click
Go to Implementation(s) Ctrl+Alt+B Cmd+Option+B
Find Usages Alt+F7 Option+F7
Go to Class Ctrl+N Cmd+O
Go to File Ctrl+Shift+N Cmd+Shift+O
Go to Symbol Ctrl+Alt+Shift+N Cmd+Option+O
Navigate Back/Forward Ctrl+Alt+Left/Right Cmd+[ / Cmd+]
Go to Last Edit Location Ctrl+Shift+Backspace Cmd+Shift+Backspace
Next/Previous Error F2 / Shift+F2 F2 / Shift+F2
Show Call Hierarchy Ctrl+Alt+H Ctrl+Option+H

Refactoring

Action Windows/Linux macOS
Refactor This Ctrl+Alt+Shift+T Ctrl+T
Rename Shift+F6 Shift+F6
Extract Method Ctrl+Alt+M Cmd+Option+M
Extract Variable Ctrl+Alt+V Cmd+Option+V
Extract Field Ctrl+Alt+F Cmd+Option+F
Extract Constant Ctrl+Alt+C Cmd+Option+C
Inline Ctrl+Alt+N Cmd+Option+N
Change Signature Ctrl+F6 Cmd+F6

Build and Run

Action Windows/Linux macOS
Build Project Ctrl+F9 Cmd+F9
Run Shift+F10 Ctrl+R
Debug Shift+F9 Ctrl+D
Run Anything Double Ctrl Double Ctrl
Stop Ctrl+F2 Cmd+F2
Step Over F8 F8
Step Into F7 F7
Resume Program F9 Cmd+Option+R

Version Control

Action Windows/Linux macOS
Commit Ctrl+K Cmd+K
Update Project Ctrl+T Cmd+T
Push Ctrl+Shift+K Cmd+Shift+K
VCS Operations Popup Alt+` Ctrl+V
Show Diff Ctrl+D Cmd+D

Remember that you can always customize these shortcuts in IntelliJ IDEA by going to File -> Settings -> Keymap (on Windows/Linux) or IntelliJ IDEA -> Preferences -> Keymap (on macOS).