IntelliJ IDEA HotKey Cheatsheet

2024 年 12 月 18 日

IntelliJ IDEA is a powerful Integrated Development Environment (IDE) widely used for Java development and also supports other programming languages. Mastering shortcuts is essential for improving development efficiency. Below are IntelliJ IDEA Windows shortcuts grouped by functionality, which can help developers write and debug code more effectively.

IntelliJ IDEA Windows Shortcuts

File Operations

ShortcutDescription
Ctrl + NFind and open a class
Ctrl + Shift + NFind and open a file
Ctrl + Alt + LFormat code
Ctrl + Shift + SSave all files
Ctrl + ERecent files
Ctrl + Shift + ERecently edited files
Ctrl + F4Close current file

Edit Operations

ShortcutDescription
Ctrl + SpaceBasic code completion
Ctrl + Shift + SpaceSmart code completion
Ctrl + /Comment/uncomment a line
Ctrl + Shift + /Comment/uncomment a block of code
Ctrl + DDuplicate current line
Ctrl + YDelete current line
Ctrl + Shift + VPaste recent clipboard content

Debug Operations

ShortcutDescription
F8Step over current line
F7Step into method/function
Shift + F8Step out of method/function
Ctrl + F5Reload and run
Ctrl + Shift + F5Stop debugging and restart
Alt + F9Run to cursor position
Ctrl + Shift + BView breakpoints

Code Navigation

ShortcutDescription
Ctrl + BGo to definition
Ctrl + Shift + BGo to type declaration
Ctrl + Alt + LeftGo to previous location
Ctrl + Alt + RightGo to next location
Ctrl + Shift + AFind action or command
Ctrl + Alt + F7Find usages

Version Control

ShortcutDescription
Ctrl + KCommit changes
Ctrl + TUpdate project
Ctrl + Shift + KPush to remote repository
Ctrl + Alt + ZView local changes
Ctrl + Shift + ZUndo commit

Find and Replace

ShortcutDescription
Ctrl + FFind
Ctrl + RReplace
Ctrl + Shift + FFind in files
Ctrl + Shift + RReplace in files
Ctrl + Shift + IFind recent files

Project and Tool Windows

ShortcutDescription
Alt + 1Show/hide project view
Alt + 4Show/hide run window
Alt + 6Show/hide database tools
Ctrl + Shift + F12Toggle full-screen mode
Ctrl + Shift + NFind project file

Other Common Operations

ShortcutDescription
Ctrl + Shift + CCopy path
Ctrl + Alt + SOpen settings
Alt + TabSwitch windows
Ctrl + QView documentation

Download IntelliJ IDEA Windows Shortcuts Cheatsheet PDF

We provide a IntelliJ IDEA Windows Shortcuts PDF download feature. Click the download button to get the file. Please note that generating the PDF may take some time, so please be patient. Download

IntelliJ IDEA macOS Shortcuts

General Operations

ShortcutDescription
Cmd + NCreate new class
Cmd + Shift + AFind and execute command
Cmd + SSave current file
Cmd + Shift + SSave all
Cmd + QQuit IntelliJ IDEA
Cmd + ,Open settings

File Operations

ShortcutDescription
Cmd + OOpen file
Cmd + Shift + OOpen class
Cmd + Shift + IOpen current file's directory
Cmd + EShow recent files
Cmd + Shift + EShow recently edited files
Cmd + WClose current tab
Cmd + Shift + WClose current window

Code Editing

ShortcutDescription
Cmd + SpaceBasic code completion
Cmd + Shift + SpaceSmart code completion
Cmd + Shift + EnterComplete current line
Cmd + Alt + LFormat code
Cmd + DDuplicate current line
Cmd + YDelete current line
Cmd + /Comment/uncomment current line
Cmd + Shift + /Comment/uncomment selected block
Cmd + Alt + TSurround selected block of code

Navigation and Search

ShortcutDescription
Cmd + BGo to definition
Cmd + Alt + BGo to implementation
Cmd + Shift + BShow file structure
Cmd + FFind in current file
Cmd + Shift + FFind in project
Cmd + RReplace in current file
Cmd + Shift + RReplace in project

Debug and Run

ShortcutDescription
Cmd + Shift + F10Run current program
Cmd + Shift + F9Debug current program
Cmd + F8Toggle breakpoint
Cmd + Option + RRerun current program
Cmd + Option + DEnter debug view

Refactoring

ShortcutDescription
Cmd + TOpen refactor menu
Cmd + Shift + RRename
Cmd + Option + MExtract method
Cmd + Option + VExtract variable
Cmd + Option + FExtract field

Version Control

ShortcutDescription
Cmd + KCommit changes
Cmd + TUpdate project
Cmd + Shift + KPush changes to remote repository
Cmd + Shift + TView version history

Window and View Management

ShortcutDescription
Cmd + 1Open project view
Cmd + 2Open structure view
Cmd + 3Open file explorer
Cmd + Shift + F12Hide all tool windows
Cmd + Shift + AFind and execute command
Cmd + Shift + F4Close current editor window

Download IntelliJ IDEA MacOS Shortcuts Cheatsheet PDF

We provide a IntelliJ IDEA macOS Shortcuts PDF download feature. Click the download button to get the file. Please note that generating the PDF may take some time, so please be patient. Download

About IntelliJ IDEA

IntelliJ IDEA is a powerful integrated development environment (IDE) developed by JetBrains, widely used for Java development but also supporting many other programming languages, including Kotlin, Scala, Groovy, Python, PHP, JavaScript, TypeScript, and more. It is renowned for its intelligent code completion, robust refactoring features, and efficient debugging tools, making it the preferred development tool for many developers.

IntelliJ IDEA provides a seamless workflow, with built-in code analysis, version control integration, database support, testing tools, and a rich plugin ecosystem, allowing developers to quickly write, debug, and deploy applications. It supports full-stack development from front-end to back-end and offers deep support for Java EE, Spring, Grails, GWT, Vaadin, Play, Android development, and more.

Additionally, IntelliJ IDEA offers intelligent code completion, error detection, quick fixes, and refactoring tools. These features not only enhance development efficiency but also help developers better understand and manage complex codebases. It also integrates with Git, Mercurial, and other version control systems, facilitating team collaboration.

IntelliJ IDEA Information

Common IntelliJ IDEA Keyboard Shortcut FAQs

  1. How to quickly switch to the last editing position in IntelliJ IDEA?
    You can quickly switch to the last editing position by pressing Cmd + Shift + Backspace. This is especially useful when jumping back to the last modified code position, and it's very efficient when working with large projects.

  2. How to quickly view the documentation of a class in IntelliJ IDEA?
    Simply place your cursor on the class name and press Cmd + Shift + P to quickly view the documentation for that class (if available). This shortcut provides an easy way to check the class's functions and usage.

  3. How to view the structure of the current file in IntelliJ IDEA?
    Press Cmd + F12 to quickly open the structure view of the current file. This will display the classes, methods, variables, and other structures within the file, helping you navigate to a specific section of the code faster.

  4. How to switch to the previous/next tab in IntelliJ IDEA?
    To switch to the previous tab, press Ctrl + Tab, and to switch to the next tab, press Ctrl + Shift + Tab. These shortcuts are great for quickly switching between multiple open files.

  5. How to quickly view all errors or warnings in the code?
    Press Cmd + 6 to open the "Inspection Results" panel and quickly see all errors, warnings, or code quality issues in the current file. If you want to check for global errors, use Cmd + Shift + A, then type "Show All Problems" to perform a global inspection.

  6. How to quickly create a new code file in IntelliJ IDEA?
    In IntelliJ IDEA, press Cmd + N to quickly create a new code file. You can choose the file type, such as a Java class, interface, enum, etc. This shortcut significantly speeds up the creation of new files, especially when you frequently need to create new classes or modules.

Mastering IntelliJ IDEA's keyboard shortcuts can significantly improve development efficiency. Whether it's file management, code editing, or debugging, keyboard shortcuts help you complete tasks more quickly. With practice and habit, you'll become more proficient with these shortcuts, making your development process smoother and more efficient.

4.7/5 - (3 votes)