Browse all keyboard shortcut cheat sheets
IntelliJ IDEA Keyboard Shortcuts (2024.x) — Complete Cheat Sheet
Navigate and refactor code faster in IntelliJ IDEA with shortcuts for search, refactoring, debugging, and code generation.
43 shortcuts across 4 categories · Windows · macOS · Linux
IntelliJ IDEA's keyboard shortcut system is one of the most powerful in any IDE, covering everything from codebase-wide search to one-key refactoring commands. Developers who master IntelliJ's shortcuts — especially Search Everywhere (Shift+Shift) and the intention actions menu (Alt+Enter) — write and navigate code significantly faster than those relying on menus and toolbars.
Search & Navigation
| Action | Shortcut | Description |
|---|---|---|
| Search Everywhere | Shift + Shift | Double-tap Shift to search files, classes, actions, and settings |
| Find in Files | Ctrl + Shift + F | Search for text across all project files |
| Go to File | Ctrl + Shift + N | Open any file by name |
| Go to Class | Ctrl + N | Jump to any class by name |
| Go to Symbol | Ctrl + Alt + Shift + N | Jump to any method or field by name |
| Go to Line | Ctrl + G | Jump to a specific line number |
| Recent Files | Ctrl + E | Show recently opened files |
| Recent Locations | Ctrl + Shift + E | Show recently edited code locations |
| Navigate Back | Ctrl + Alt + ← | Go back to the previous cursor location |
| Navigate Forward | Ctrl + Alt + → | Go forward to the next cursor location |
| Go to Declaration | Ctrl + B | Jump to the declaration of the symbol under cursor |
| Find Usages | Alt + F7 | Find all usages of the symbol under cursor |
| Next Error | F2 | Jump to the next error or warning in the file |
Editing
| Action | Shortcut | Description |
|---|---|---|
| Basic Completion | Ctrl + Space | Show basic code completion suggestions |
| Smart Completion | Ctrl + Shift + Space | Show type-aware smart code completion |
| Show Intention Actions | Alt + Enter | Show quick-fix and intention actions (the lightbulb) |
| Generate Code | Alt + Insert | Generate constructors, getters, setters, overrides |
| Surround With | Ctrl + Alt + T | Surround selected code with if, try-catch, loops, etc. |
| Comment / Uncomment Line | Ctrl + / | Toggle line comment on the selected line(s) |
| Comment Block | Ctrl + Shift + / | Toggle block comment around selected code |
| Duplicate Line | Ctrl + D | Duplicate the current line or selection |
| Delete Line | Ctrl + Y | Delete the entire current line |
| Move Line Up | Alt + Shift + ↑ | Move the current line up |
| Move Line Down | Alt + Shift + ↓ | Move the current line down |
| Expand Selection | Ctrl + W | Progressively expand the code selection |
| Reformat Code | Ctrl + Alt + L | Reformat the file or selection to match code style |
| Optimize Imports | Ctrl + Alt + O | Remove unused imports and sort them |
Refactoring
| Action | Shortcut | Description |
|---|---|---|
| Rename | Shift + F6 | Rename a symbol and update all references |
| Extract Variable | Ctrl + Alt + V | Extract selected expression into a variable |
| Extract Method | Ctrl + Alt + M | Extract selected code into a new method |
| Extract Field | Ctrl + Alt + F | Extract selected expression into a field |
| Inline | Ctrl + Alt + N | Inline a variable, method, or field |
| Change Signature | Ctrl + F6 | Change a method's signature and update all callers |
| Move | F6 | Move a class, method, or file to another location |
Run & Debug
| Action | Shortcut | Description |
|---|---|---|
| Run | Shift + F10 | Run the current run configuration |
| Debug | Shift + F9 | Run the current configuration in debug mode |
| Step Over | F8 | Execute the current line and move to the next |
| Step Into | F7 | Step into the method call on the current line |
| Step Out | Shift + F8 | Step out of the current method |
| Resume Program | F9 | Continue running until the next breakpoint |
| Toggle Breakpoint | Ctrl + F8 | Add or remove a breakpoint on the current line |
| Stop | Ctrl + F2 | Stop the running process |
| Evaluate Expression | Alt + F8 | Evaluate a custom expression during debugging |
IntelliJ IDEA Tips & Tricks
- Double Shift is the single most powerful shortcut: Search Everywhere (Shift+Shift) finds anything — files, classes, methods, settings, IDE actions. If you learn only one IntelliJ shortcut, make it this one. It replaces Go to File, Go to Class, and the Actions menu combined.
- Alt+Enter fixes almost every highlighted problem: Whenever you see a red, yellow, or green highlight, press Alt+Enter. IntelliJ will offer to add imports, fix type mismatches, create missing methods, implement interfaces, and dozens more context-aware fixes automatically.
- Ctrl+W to expand selection is faster than clicking: Place your cursor anywhere and press Ctrl+W once to select the word, again to select the expression, again to select the block, and so on. Combined with refactoring shortcuts, you can extract a method without touching the mouse.
Frequently Asked Questions — IntelliJ IDEA
- What is the most important IntelliJ IDEA shortcut?
- Double-tapping Shift (Search Everywhere) is the single most powerful shortcut in IntelliJ IDEA. It lets you search for files, classes, methods, IDE actions, and settings all from one box. If you only learn one shortcut, make it this one.
- How do I rename a variable or class in IntelliJ IDEA?
- Place the cursor on the variable, class, or method name and press Shift+F6 to rename it. IntelliJ IDEA will update every reference across the entire project automatically. It is much safer than a plain Find & Replace because it understands code scope.
- How do I reformat code in IntelliJ IDEA?
- Press Ctrl+Alt+L (Cmd+Option+L on Mac) to reformat the current file or selection to match your project's code style settings. Press Ctrl+Alt+O (Cmd+Option+O) to optimize imports (remove unused ones and sort them) at the same time.
- How do I add multiple cursors in IntelliJ IDEA?
- Hold Alt and click to place additional cursors at different positions. You can also press Ctrl+Shift+Alt+J (Cmd+Ctrl+G on Mac) to select all occurrences of the current identifier and edit them all simultaneously — useful for batch renaming within a file.
How to Learn IntelliJ IDEA Keyboard Shortcuts
IntelliJ IDEA has one of the most comprehensive keyboard shortcut systems of any integrated development environment, and it's organized around a philosophy of minimizing the distance between developer intent and code action. The most important shortcut in the entire IntelliJ ecosystem is Shift+Shift — Search Everywhere — which lets you find and open any file, class, method, action, or setting by typing part of its name. This single shortcut replaces navigating menus, file trees, and settings dialogs. Close behind it is Alt+Enter — the intention action menu — which appears when the cursor is on a warning or error and offers contextual fixes, refactoring suggestions, and code generation options. Developers who build the habit of pressing Alt+Enter whenever they see a yellow or red underline find that IntelliJ resolves the majority of common coding issues automatically.
IntelliJ's refactoring shortcuts are what set it apart from lighter editors like VS Code for large Java, Kotlin, or Scala codebases. Shift+F6 renames a symbol across all usages in the entire project, including different files. Ctrl+Alt+M extracts selected code into a new method. Ctrl+Alt+V introduces a new variable. Ctrl+Alt+C extracts a constant. These refactoring operations are safe — IntelliJ analyzes the codebase before making changes — which means they can be used frequently and confidently without careful manual checking. F2 navigates between errors and warnings in the current file, making it easy to systematically work through a list of issues without scrolling. For developers working in IntelliJ-based IDEs (including Android Studio, WebStorm, PyCharm, and RubyMine), the investment in learning these shortcuts applies across the entire JetBrains product family.