⌃IImplementation methods (implement methods in the interface)
⌘⌥TSurround the code (use if…else, try…catch, for, synchronized, etc. to surround the selected code)
⌘/Comment/uncomment and line comments
⌘⌥/Comment/uncomment and block comments
⌥↑Select code blocks continuously
⌥↓Reduce the currently selected code block
⌃⇧QShow contextual information
⌥↩Show intent actions and quick fix code
⌘⌥LFormat code
⌃⌥OOptimize import
⌃⌥Iautomatic indent line
⇥ / ⇧⇥Indent code/anti-indent code
⌘XCut the current line or selected block to the clipboard
⌘CCopies the current line or selected block to the clipboard
⌘VPaste from clipboard
⌘⇧VPaste from nearest buffer
⌘DCopy the current line or selected block
⌘⌫Delete the current row or rows of a selected block
⌃⇧JIntelligently splice code into one line
⌘↩Intelligent splitting of spliced rows
⇧↩start a new line
⌘⇧UCase switching
⌘⇧] / ⌘⇧[Select until end/beginning of code block
⌥⌦Delete to the end of the word (⌦ key is Fn+Delete)
⌥⌫Delete to beginning of word
⌘+ / ⌘-Expand/collapse code blocks
⌘⇧+Expand all code blocks
⌘⇧-Collapse all code blocks
⌘WClose active editor tab
Search/Replace (query/replace)
Double ⇧Query anything
⌘FSearch within file
⌘GIn search mode, search down
⌘⇧GIn search mode, search upward
⌘RIn-file replacement
⌘⇧FGlobal search (based on path)
⌘⇧RGlobal replacement (based on path)
⌘⇧SQuery structure (exclusive for Ultimate Edition, needs to be set in Keymap)
⌘⇧MReplacement structure (exclusive for Ultimate Edition, needs to be set in Keymap)
Usage Search
⌥F7 / ⌘F7Find usage in file/Find usage in class
⌘⇧F7Highlight usage in files
⌘⌥F7Show usage
Compile and Run
⌘F9Compile Project
⌘⇧F9Compile selected files, packages or modules
⌃⌥RPop up Run's selectable menu
⌃⌥DPop up Debug selectable menu
⌃Rrun
⌃Ddebug
⌃⇧R, ⌃⇧DRun context configuration from editor
Debugging
F8Go to the next step. If the current line breakpoint is a method, do not enter the current method body.
F7Go to the next step. If the current line breakpoint is a method, it will enter the current method body. If there is a method in the method body, it will not enter the embedded method.
⇧F7Smart step-in, if there are multiple method calls on the line where the breakpoint is located, which method to enter will pop up
⇧F8Jump out
⌥F9Run to the cursor. If there are other breakpoints before the cursor, the breakpoint will be entered.
⌥F8Calculate expressions (variable values can be changed to make them effective)
⌘⌥RResume the program running. If there is a breakpoint in the code below the breakpoint, it will stop at the next breakpoint.
⌘F8Switch breakpoints (if there is a breakpoint in the current line of the cursor, the breakpoint will be canceled, if not, the breakpoint will be added)
⌘⇧F8View breakpoint information
Navigation
⌘OFind class files
⌘⇧OFind all types of files, open files, and open directories. To open a directory, you need to add a backslash before or after the input content./
⌘⌥OGo to the specified variable/method
⌃← / ⌃→Switch the open editing tab page left or right
F12Return to previous tool window
⎋Enter the code file window from the tool window
⇧⎋Hide the current or last active window and the cursor enters the code file window
⌘⇧F4Close activity run/messages/find/… tab
⌘LJump to the specified position of a certain line in the current file
⌘EDisplay a list of recently opened file records
⌘⌥← / ⌘⌥→Go back/forward to the previous operation
⌘⇧⌫Jump to the last edited location
⌥F1Display the current file selection target pop-up layer. There are many targets in the pop-up layer that can be selected (for example, in the code editing window, you can choose to display the Finder of the file)
⌘B / ⌘ 鼠标点击Enter the interface or definition of the method/variable where the cursor is located
⌘⌥BJump to the implementation. If used on a called method name, it will jump to the specific implementation. You can skip the interface.
⌥ Space, ⌘YQuickly open the definition of the method or class where the cursor is located
⌃⇧BJump to type declaration
⌘UGo to the method/interface definition of the parent class of the method where the current cursor is located
⌃↓ / ⌃↑The current cursor jumps to the previous/next method name position of the current file
⌘] / ⌘[Move the cursor to the beginning/end of the curly brace of the current code
⌘F12Pops up the current file structure layer, and you can enter directly on the pop-up layer to filter (can be used to search for methods in classes)
⌃HShow the current class hierarchy
⌘⇧HShow method hierarchy
⌃⌥HShow call hierarchy
F2 / ⇧F2Jump to next/previous location of highlighted error or warning
F4 / ⌘↓Edit/view code source
⌥ HomeShow navigation bar to current file
F3Select files/folders/code lines and add/cancel bookmarks
⌥F3Select a file/folder/line of code and use mnemonics to add/unbookmark
⌃0...⌃9Locate the bookmark position corresponding to the value
⌘F3Show all bookmarks
Refactoring
F5Copy files to specified directory
F6Move files to specified directory
⌘⌫To safely delete the file on the file, a confirmation box pops up.
⇧F6Rename file
⌘F6Change signature
⌘⌥Nconsistency
⌘⌥MExtract selected code as method
⌘⌥VExtract variables
⌘⌥FExtract fields
⌘⌥CExtract constants
⌘⌥PExtract parameters
VCS/Local History (version control/local history)
⌘KSubmit code to version controller
⌘TUpdate code from version controller
⌥⇧CView recent change history
⌃CQuickly pop up the version controller operation panel
Live Templates (dynamic code templates)
⌘⌥JA template selection window pops up and the selected code is wrapped in a dynamic template.
⌘JInsert custom dynamic code template
General
⌘1...⌘9Open the corresponding numbered tool window
⌘Ssave all
⌘⌥YSync, refresh
⌃⌘FToggle full screen mode
⌘⇧F12Switch maximized editor
⌥⇧FAdd to Favorites
⌥⇧ICheck current file with current configuration file
`§⌃, ⌃“ Quickly switch the current scheme (switching themes, code styles, etc.)
⌘,Open IDEA system settings
⌘;Open the project structure dialog
⇧⌘ASearch action (relevant options can be set)
⌃⇥Switch between editing window labels and tool windows (if you press delete during the switching process, the corresponding selected window will be closed)
Other (some shortcut keys not reflected in official documents)
⌘⇧8Vertical editing mode
navigation
⌘OFind class filesCtrl + N
⌘⌥OGo to the specified variable/methodCtrl + Shift + Alt + N
⌃←/ ⌃→Switch the open editing tab page left or right Alt←/Alt→
⎋Enter the code file window from the tool windowESC
⌘LJump to the specified position of a certain line in the current fileCtrl + G
⌘EDisplay a list of recently opened file recordsCtrl + E
⌘⌥←/ ⌘⌥→Back/ Forward to the previous operation Ctrl + Alt + ←/Ctrl + Alt + →
⌘⇧⌫Jump to the last edited location
⌃HShow the current class hierarchyCtrl + H
⌘⇧HShow method hierarchy
⌃⌥HShow call hierarchy
F4/ ⌘↓edit/viewcodesource
⌘⌥UDisplay class UML diagram
⌃JView comments
edit
⌥⌦Delete to end of word ( ⌦key is Fn+Delete)
⌥⌫Delete to beginning of word
⌘+/ ⌘-expand/collapse code block
⌘F1Display detailed description information for errors or warnings
⌘⌥LFormat code
⌃⌥OOptimize import
⇧↩start a new line
⌘⇧↩Automatically end the code and automatically add a semicolon at the end of the line
⌃IImplementation methods (implement methods in the interface)
⌘B/ ⌘ 鼠标点击Enter the interface or definition of the method/variable where the cursor is located
⌃⇧BJump to type declaration
⌥ Space, ⌘Yquickly open the definition of the method and class where the cursor is located
⌘OFind class files
⌘⇧OFind all types of files, open files, and open directories. To open a directory, you need to add a backslash / before or after the input content.
F12Return to previous tool window
⎋Enter the code file window from the tool window
⇧⎋Hide the current or last active window and the cursor enters the code file window
F3选中文件/文件夹/代码行, add/cancel bookmarks
⌥F3 选中文件/文件夹/代码行, add/cancel bookmarks using mnemonics
⌃0…⌃9Locate the bookmark position corresponding to the value
⌘F3Show all bookmarks
⌥F1Display the current file selection target pop-up layer. There are many targets in the pop-up layer that can be selected (for example, in the code editing window, you can choose to display the Finder of the file)
⌘F12Pops up the current file structure layer, and you can enter directly on the pop-up layer to filter (can be used to search for methods in classes)