IntelliJ IDEA HotKeys

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

Shortcut Description
Ctrl + N Find and open a class
Ctrl + Shift + N Find and open a file
Ctrl + Alt + L Format code
Ctrl + Shift + S Save all files
Ctrl + E Recent files
Ctrl + Shift + E Recently edited files
Ctrl + F4 Close current file

Edit Operations

Shortcut Description
Ctrl + Space Basic code completion
Ctrl + Shift + Space Smart code completion
Ctrl + / Comment/uncomment a line
Ctrl + Shift + / Comment/uncomment a block of code
Ctrl + D Duplicate current line
Ctrl + Y Delete current line
Ctrl + Shift + V Paste recent clipboard content

Debug Operations

Shortcut Description
F8 Step over current line
F7 Step into method/function
Shift + F8 Step out of method/function
Ctrl + F5 Reload and run
Ctrl + Shift + F5 Stop debugging and restart
Alt + F9 Run to cursor position
Ctrl + Shift + B View breakpoints

Code Navigation

Shortcut Description
Ctrl + B Go to definition
Ctrl + Shift + B Go to type declaration
Ctrl + Alt + Left Go to previous location
Ctrl + Alt + Right Go to next location
Ctrl + Shift + A Find action or command
Ctrl + Alt + F7 Find usages

Version Control

Shortcut Description
Ctrl + K Commit changes
Ctrl + T Update project
Ctrl + Shift + K Push to remote repository
Ctrl + Alt + Z View local changes
Ctrl + Shift + Z Undo commit

Find and Replace

Shortcut Description
Ctrl + F Find
Ctrl + R Replace
Ctrl + Shift + F Find in files
Ctrl + Shift + R Replace in files
Ctrl + Shift + I Find recent files

Project and Tool Windows

Shortcut Description
Alt + 1 Show/hide project view
Alt + 4 Show/hide run window
Alt + 6 Show/hide database tools
Ctrl + Shift + F12 Toggle full-screen mode
Ctrl + Shift + N Find project file

Other Common Operations

Shortcut Description
Ctrl + Shift + C Copy path
Ctrl + Alt + S Open settings
Alt + Tab Switch windows
Ctrl + Q View documentation

IntelliJ IDEA macOS Shortcuts

General Operations

Shortcut Description
Cmd + N Create new class
Cmd + Shift + A Find and execute command
Cmd + S Save current file
Cmd + Shift + S Save all
Cmd + Q Quit IntelliJ IDEA
Cmd + , Open settings

File Operations

Shortcut Description
Cmd + O Open file
Cmd + Shift + O Open class
Cmd + Shift + I Open current file's directory
Cmd + E Show recent files
Cmd + Shift + E Show recently edited files
Cmd + W Close current tab
Cmd + Shift + W Close current window

Code Editing

Shortcut Description
Cmd + Space Basic code completion
Cmd + Shift + Space Smart code completion
Cmd + Shift + Enter Complete current line
Cmd + Alt + L Format code
Cmd + D Duplicate current line
Cmd + Y Delete current line
Cmd + / Comment/uncomment current line
Cmd + Shift + / Comment/uncomment selected block
Cmd + Alt + T Surround selected block of code

Navigation and Search

Shortcut Description
Cmd + B Go to definition
Cmd + Alt + B Go to implementation
Cmd + Shift + B Show file structure
Cmd + F Find in current file
Cmd + Shift + F Find in project
Cmd + R Replace in current file
Cmd + Shift + R Replace in project

Debug and Run

Shortcut Description
Cmd + Shift + F10 Run current program
Cmd + Shift + F9 Debug current program
Cmd + F8 Toggle breakpoint
Cmd + Option + R Rerun current program
Cmd + Option + D Enter debug view

Refactoring

Shortcut Description
Cmd + T Open refactor menu
Cmd + Shift + R Rename
Cmd + Option + M Extract method
Cmd + Option + V Extract variable
Cmd + Option + F Extract field

Version Control

Shortcut Description
Cmd + K Commit changes
Cmd + T Update project
Cmd + Shift + K Push changes to remote repository
Cmd + Shift + T View version history

Window and View Management

Shortcut Description
Cmd + 1 Open project view
Cmd + 2 Open structure view
Cmd + 3 Open file explorer
Cmd + Shift + F12 Hide all tool windows
Cmd + Shift + A Find and execute command
Cmd + Shift + F4 Close current editor window

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.

5/5 - (2 votes)