Today, I would like to share with you, IntelliJ IDEA 2021 Win and Mac shortcut keys, all basic functions of IDEA can be completed by shortcut keys. It can be said that if you master all IDEA shortcut keys, then you can completely lose the mouse. , And does not affect development efficiency.
IntelliJ IDEA Shortcut Key Encyclopedia Win Edition
Ctrl shortcut
Ctrl + F Search for text in the current file (required)
Ctrl + R to replace text in the current file (required)
Ctrl + Z undo (required)
Ctrl + Y delete the line where the cursor is or delete the selected line (required)
Ctrl + X Cut the line where the cursor is or cut the selection
Ctrl + C Copy the line where the cursor is or copy the selection
Ctrl + D Copy the line where the cursor is or copy the selected content, and insert the copied content below the cursor position (required)
Ctrl + W Progressively select code blocks. You can select the word or paragraph where the cursor is located, and pressing continuously will expand the selected range on the basis of the original selection (required)
Ctrl + E displays a list of recently opened file records (required)
Ctrl + N Search for class files according to the input name/class name (required)
Ctrl + G jump to the specified line in the current file
Ctrl + J insert custom dynamic code template (required)
Ctrl + P method parameter prompt display (required)
Ctrl + Q Above the variable/class name/method name, etc. where the cursor is located (you can also press when prompted to add), display the content of the document
Ctrl + U Go to the method/interface definition of the parent class of the method where the cursor is currently located (required)
Ctrl + B Enter the interface or definition of the method/variable where the cursor is located, which is equivalent to Ctrl +
Left click (required)
Ctrl + K version control to submit the project, this project needs to be added to version control to be available
Ctrl + T version control update project, this project needs to be added to version control to be available
Ctrl + H displays the hierarchy of the current class
Ctrl + O to select the rewritable method
Ctrl + I select inheritable method
Ctrl + + Expand code
Ctrl +-Collapse code
Ctrl + / to release the line of code where the cursor is located, and different comment symbols will be used according to the current different file types (required)
Ctrl + U Go to the method/interface definition of the parent class of the method where the cursor is currently located (required)
Ctrl + B Enter the interface or definition of the method/variable where the cursor is located, which is equivalent to Ctrl + left click (required)
Ctrl + K version control to submit the project, this project needs to be added to version control to be available
Ctrl + T version control update project, this project needs to be added to version control to be available
Ctrl + H displays the hierarchy of the current class
Ctrl + O to select rewritable method
Ctrl + I select inheritable method
Ctrl + + Expand code
Ctrl +-Collapse code
Ctrl + / to release the line of code where the cursor is located, and different comment symbols will be used according to the current different file types (required)
Ctrl + [Move the cursor to the beginning of the curly brace of the current code
Ctrl +] Move the cursor to the end of the curly brace of the current code
Ctrl + F1 displays error information at the error code where the cursor is (required)
Ctrl + F3 to switch to the next reference position of the selected word (required)
Ctrl + F4 Close the currently edited file
Ctrl + F8 In Debug mode, set the current behavior of the cursor to a breakpoint, if it is already a breakpoint, remove the breakpoint
Ctrl + F9 execute Make Project operation
Ctrl + F11 Select files/folders, use mnemonics to set/cancel bookmarks (required)
Ctrl + F12 Pop up the current file structure layer, you can directly input on the pop-up layer to filter
Ctrl + Tab edit window switching, if you press delete during the switching process, it will close the corresponding selected window
Ctrl + End jump to the end of the file
Ctrl + Home jump to the beginning of the file
Ctrl + Space basic code completion, it is occupied by the input method by default on Windows system and needs to be modified. It is recommended to modify it to Ctrl + comma (required)
Ctrl + Delete delete the word or Chinese sentence behind the cursor (required)
Ctrl +BackSpace delete the word or Chinese sentence in front of the cursor (required)
Ctrl +1,2,3...9 Navigate to the bookmark position of the corresponding value (required)
Ctrl + left click on the title of the opened file, the file path will pop up (required)
Ctrl + cursor positioning, press Ctrl, don’t let go, the summary of the category information where the cursor is will be displayed
Ctrl + left arrow key to jump the cursor to the beginning of the left side of the current word/Chinese sentence (required)
Ctrl + right arrow key to jump the cursor to the beginning of the current word/Chinese sentence on the right (required)
Ctrl + forward arrow is equivalent to the mouse wheel forward effect (required)
Ctrl + back arrow is equivalent to the backward effect of the mouse wheel (required)
2. Alt shortcut key
Alt + display version control common operation menu pop-up layer (required)
Alt + Q pops up a prompt showing the declaration/context information of the current class
Alt + F1 displays the current file selection target pop-up layer, there are many targets in the pop-up layer to select (required)
Alt + F2 For the previous page, display various browsers to open the target selection pop-up layer
Alt + F3 Select the text, find the same text one by one, and highlight it
Alt + F7 Find the method/variable/class where the cursor is called
Alt + F8 In the Debug state, select the object, and a debugging box for inputting calculation expressions will pop up to view the debugging results of the input content
Alt + Home Navigate/display the Navigation Bar to the current file
Alt + Enter IntelliJ IDEA provides quick fix options according to the cursor position, and the cursor position is different.
The result is also different (required)
Alt + Insert code is automatically generated, such as the set / get method of the generated object, the constructor, toString(), etc. (required)
Alt + left arrow key to switch the sub-views in the currently opened window. For example, there are Output, Debugger and other sub-views in the Debug window. You can use this shortcut to switch between the sub-views (required)
Alt + Right Arrow Press to switch the sub-views in the currently opened window. For example, there are Output, Debugger and other sub-views in the Debug window. You can use this shortcut to switch between the sub-views (required)
Alt + forward direction key, the current cursor jumps to the previous method name position of the current file (required)
Alt + back arrow key The current cursor jumps to the next method name position of the current file (required)
Alt +1,2,3...9 displays the tabs corresponding to the values, of which 1 is the most used by Project (required)
Three, Shift shortcut keys
Shift + F1 If there is an external document, you can connect to an external document
Shift + F2 jump to the previous highlighted error or warning position
Shift + F3 In search mode, search for the previous match
Shift + F4 Use the new Windows window to open the currently opened file, and keep the old window
Shift + F6 rename file/folder
Shift + F7 In Debug mode, enter intelligently. There are multiple method calls on the line where the breakpoint is located, which method will pop up
Shift + F8 In Debug mode, jump out, the effect is the same as F9
Shift + F9 is equivalent to clicking the Debug button on the toolbar
Shift + F10 is equivalent to clicking the Run button on the toolbar
Shift + F11 pop up the bookmark display layer (required)
Shift + Tab cancel indentation (required)
Shift + ESC hide the current or last active tool window
Shift + End select the cursor to the end of the current line
Shift + Home Select the cursor to the beginning of the current line
Shift + Enter to start a new line. A line is left under the line where the cursor is located, and the cursor is positioned at the new line (required)
Shift + left-click and press this shortcut on the open file name to close the currently open file (required)
Shift + scroll wheel to scroll forward and backward of the current file. Horizontal scrolling axis scrolling (required)
Four, Ctrl + Alt shortcut keys
Ctrl + Alt + L format code, which can be used for the current file and the entire package directory (required)
Ctrl + Alt + O optimize the imported classes, which can be used for the current file and the entire package directory (required)
Ctrl + Alt + I Automatic code indentation of the line or selected part of the cursor, a bit similar to formatting
Ctrl + Alt + T pop up the surrounding option pop-up layer for the selected code (required)
Ctrl + Alt + J pop up the template selection window, add the selected code to the dynamic template
Ctrl + Alt + H call level
Ctrl + Alt + B will jump to the specific implementation when used on a called method name, and you can skip the interface
Ctrl + Alt + V quickly introduce variables
Ctrl + Alt + Y sync, refresh
Ctrl + Alt + S Open IntelliJ IDEA system settings (required)
Ctrl + Alt + F7 shows the place of use. Find the place where the class or variable is called, and find out by means of a pop-up box
Ctrl + Alt + F11 switch full screen mode
Ctrl + Alt + Enter blank a line on the line where the cursor is located, and the cursor is positioned to the new line (required)
Ctrl + Alt + Home Pop up the file pop-up layer associated with the current file
Ctrl + Alt + Space class name automatic completion
Ctrl + Alt + left arrow key to return to the previous operation (required)
Ctrl + Alt + right arrow key to advance to the previous operation (required)
Ctrl + Alt + forward arrow key in search mode, jump to the last searched file
Ctrl + Alt + back arrow key in search mode, jump to the next searched file
Five, Ctrl + Shift shortcut keys
Ctrl + Shift + F Find the entire project or files in the specified directory according to the input content (required)
Ctrl + Shift + R replace the corresponding content according to the input content, the scope is the entire project or the files in the specified directory (required)
Ctrl + Shift + J automatically merge the next line to the end of the current line (required)
Ctrl + Shift + Z Cancel undo (required)
Ctrl + Shift + W Progressively deselect code blocks. You can select the word or paragraph where the cursor is located, and pressing continuously will expand the deselected range on the basis of the original selection (required)
Ctrl + Shift + N Locate/open a file/directory by file name, and open the directory in
Add a forward slash after the input (required)
Ctrl + Shift + U Turn upper/lower case conversion on the selected code (required)
Ctrl + Shift + T generates a unit test class for the current class, if there is an existing unit test class, you can select it (required)
Ctrl + Shift + C Copy the current file disk path to the clipboard (required)
Ctrl + Shift + V Pop up the cached recently copied content manager pop-up layer
Ctrl + Shift + E displays the pop-up layer of the recently modified file list
Ctrl + Shift + H show method hierarchy
Ctrl + Shift + B jump to the type declaration (required)
Ctrl + Shift + I quickly view the definition of the method or class where the cursor is located
Ctrl + Shift + A search action/setting
Ctrl + Shift + / code block comment (required)
Ctrl + Shift + [Select from the cursor position to its top bracket position (required)
Ctrl + Shift +] Select from the cursor position to its bottom bracket position (required)
Ctrl + Shift + + Expand all codes (required)
Ctrl + Shift +-Collapse all codes (required)
Ctrl + Shift + F7 highlight all the selected text, press Esc to highlight and disappear (required)
Ctrl + Shift + F8 In Debug mode, specify the breakpoint entry condition
Ctrl + Shift + F9 compile the selected file/package/module
Ctrl + Shift + F12 to maximize the editor (required)
Ctrl + Shift + Space smart code prompt
Ctrl + Shift + Enter automatically end the code, automatically add a semicolon at the end of the line (required)
Ctrl + Shift +Backspace Back to the last modified place (required)
Ctrl + Shift +1,2,3...9 Quickly add bookmarks with specified values (required)
Ctrl + Shift + left click to place the cursor on a certain class variable, press this shortcut key to directly locate the class
(Required)
Ctrl + Shift + left arrow key on the code file, the cursor jumps to the left beginning of the current word/Chinese sentence, and select the word/Chinese sentence at the same time (required)
Ctrl + Shift + right arrow key on the code file, the cursor jumps to the beginning of the current word/Chinese sentence on the right side, and select the word/Chinese sentence at the same time
Ctrl + Shift + forward arrow keys cursor on the method name, move the method to the previous method, adjust the method order (required)
Ctrl + Shift + back arrow keys The cursor is placed on the method name, the method is moved to the front of the next method, and the method is adjusted
Ctrl + Shift + right arrow key on the code file, the cursor jumps to the beginning of the current word/Chinese sentence on the right side, and select the word/Chinese sentence at the same time (required)
Ctrl + Shift + forward arrow keys cursor on the method name, move the method to the front of the previous method, adjust the method order
(Required)
Ctrl + Shift + back arrow keys The cursor is placed on the method name, the method is moved to the front of the next method, and the method is adjusted
Sort (required)
Six, Alt + Shift shortcut keys
Alt + Shift + N select/add task (required)
Alt + Shift + F Display add to favorites pop-up layer / add to favorites
Alt + Shift + C View the list of changes in recent operation items
Alt + Shift + I View the current file of the project
Alt + Shift + F7 In Debug mode, the next step is to enter the current method body. If the method body still has a method, it will enter the embedded method, and then loop to enter
Alt + Shift + F9 pops up the Debug selectable menu
Alt + Shift + F10 pops up the selectable menu of Run
Alt + Shift + Double-click to select the double-clicked word/Chinese sentence, hold down, you can select other words/Chinese sentences at the same time (required)
Alt + Shift + forward arrow keys to move the line where the cursor is and move up (required)
Alt + Shift + back arrow keys to move the line where the cursor is and move down (required)
Seven, Ctrl + Shift + Alt shortcut keys
Ctrl + Shift + Alt + V Paste without formatting (required)
Ctrl + Shift + Alt + N Go to the specified variable/method
Ctrl + Shift + Alt + S Open the current project settings (required)
Ctrl + Shift + Alt + C copy reference information
8. Other shortcut keys
F2 Jump to the next highlighted error or warning position (required)
F3 In search mode, locate to the next match
F4 edit source (required)
F7 In Debug mode, go to the next step. If the current line breakpoint is a method, then enter the current method body, if the method body has a method, it will not enter the embedded method
F8 In Debug mode, enter the next step. If the current line breakpoint is a method, it will not enter the current method body
F9 In Debug mode, the program is resumed, but if there is a breakpoint in the code below the breakpoint, it will stop at the next breakpoint
F11 add bookmark (required)
F12 Go back to the previous tool window (required)
Tab indentation (required)
ESC Enter the code file window from the tool window (required) Double press Shift twice to pop up the Search Everywhere pop-up layer
IntelliJ IDEA shortcut keys for Mac
Description of Mac keyboard symbols and modifier keys
⌘ Command
⇧ Shift
⌥ Option
⌃ Control
↩︎ Return/Enter
⌫ Delete
⌦ Forward delete key (Fn+Delete)
↑ up arrow
↓ down arrow
← Left arrow
→ Right arrow
⇞ Page Up(Fn+↑)
⇟ Page Down(Fn+↓)
Home Fn + ←
End Fn + →
⇥ Right tab (Tab key)
⇤ Left Tab (Shift+Tab)
⎋ Escape (Esc)
Editing
⌃Space basic code completion (complete any class, method, variable)
⌃⇧Space smart code completion (list of filter methods and expected types of variables)
⌘⇧↩ automatically end the code, automatically add a semicolon at the end of the line
⌘P Display method parameter information
⌃J, Mid. button click Quick view document
⇧F1 View external documents (on some codes, it will trigger to open the browser to display related documents)
⌘+Move the mouse on the code to display the brief information of the code
⌘F1 Display specific description information at the error or warning
⌘N, ⌃↩, ⌃N Generate code (getter, setter, constructor,
hashCode/equals,toString)
⌃O Override method (override parent class method)
⌃I Implementation method (implement method in interface)
⌘⌥T surround code (use if..else, try..catch, for, synchronized, etc. surround
Selected code)
⌘/ comment/uncomment and line comment
⌘⌥/Comment/Uncomment and block comment
⌥↑ Continuously select code blocks
⌥↓ Reduce the currently selected code block
⌃⇧Q Display contextual information
⌥↩ Show intention actions and quick fix codes
⌘⌥L format code
⌃⌥O optimize import
⌃⌥I Automatic indent line
⇥ / ⇧⇥ Indented code / Unindented code
⌘X Cut current line or selected block to clipboard
⌘C Copy the current line or selected block to the clipboard
⌘V Paste from clipboard
⌘⇧V Paste from the nearest buffer
⌘D Copy the current line or selected block
⌘⌫ Delete the current line or the selected block line
⌃⇧J Smartly splice the code into one line
⌘↩ Smart split and spliced rows
⇧↩ start a new line
⌘⇧U case switch
⌘⇧] / ⌘⇧[ select until the end/start of the code block
⌥⌦ Delete to the end of the word (⌦ key is Fn+Delete)
⌥⌫ Delete to the beginning of the word
⌘+ / ⌘- expand/collapse code block
⌘⇧+ expand so the code block
⌘⇧- Collapse all code blocks
⌘W Close the active editor tab
Search/Replace (query/replace)
Double ⇧ query anything
⌘F Search in file
⌘G In search mode, search down
⌘⇧G In search mode, search upwards
⌘R file replacement
⌘⇧F Global search (according to path)
⌘⇧R global replacement (according to path)
⌘⇧S Query structure (only for Ultimate Edition version, need to be set in Keymap)
⌘⇧M Replacement structure (Special for Ultimate Edition version, need to be set in Keymap)
Usage Search
⌥F7 / ⌘F7 Find usage in file/ Find usage in class
⌘⇧F7 highlighted usage in the file
⌘⌥F7 display usage
Compile and Run
⌘F9 Compile Project
⌘⇧F9 Compile the selected file, package or module
⌃⌥R Pop up the selectable menu of Run
⌃⌥D pop-up Debug selectable menu
⌃R run
⌃D debugging
⌃⇧R, ⌃⇧D Run context environment configuration from editor
Debugging
F8 Go to the next step, if the current line breakpoint is a method, it will not enter the current method body
F7 Go to the next step, if the current line breakpoint is a method, then enter the current method body, if this
If the method body has a method, it will not enter the embedded method
⇧F7 Smart step in, there are multiple method calls on the line where the breakpoint is located, which method will pop up to enter
⇧F8 jump out
⌥F9 runs to the cursor, if there is another breakpoint before the cursor, it will enter the breakpoint
⌥F8 calculation expression (variable value can be changed to make it effective)
⌘⌥R Resume the program, if there is a breakpoint in the code below the breakpoint, it will stop at the next breakpoint
⌘F8 Switch breakpoint (if the cursor has a breakpoint in the current line, cancel the breakpoint, if not, add a breakpoint)
⌘⇧F8 View breakpoint information
Navigation
⌘O Find class files
⌘⇧O Find all types of files, open files, and open directories. To open a directory, you need to add a backslash/ before or after the input.
⌘⌥O Go to the specified variable/method
⌃← / ⌃→ Switch the open edit tab page left and right
F12 Return to the 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
⌘⇧F4 Close activity run/messages/find/... tab
⌘L Jump to the specified place of a certain line in the current file
⌘E Display the record list of recently opened files
⌘⌥← / ⌘⌥→ Back/forward to the previous operation
⌘⇧⌫ Jump to the last edited place
⌥F1 displays the current file selection target pop-up layer, there are many targets in the pop-up layer to choose from (such as
The code editing window can select the Finder that displays the file)
⌘B / ⌘ Click the mouse to enter the interface or definition of the method/variable where the cursor is located
⌘⌥B Jump to the implementation, use it on a called method name, it will jump to the specific implementation, you can skip the interface
⌥ Space, ⌘Y Quickly open the definition of the method and class where the cursor is located
⌃⇧B Jump to the type declaration
⌘U Go to the method/interface definition of the parent class of the method where the cursor is currently located
⌃↓ / ⌃↑ The current cursor jumps to the previous/next method name position of the current file
⌘] / ⌘[ Move the cursor to the start/end position of the curly brace of the current code
⌘F12 Pop up the current file structure layer, you can directly input on the pop-up layer to filter (can be used to search for methods in the class)
⌃H Display the hierarchy of the current class
⌘⇧H Display method hierarchy
⌃⌥H Display call hierarchy
F2 / ⇧F2 Jump to the next/previous position that highlights the error or warning
F4 / ⌘↓ edit/view code source
⌥ Home displays the navigation bar to the current file
F3 select file/folder/code line, add/cancel bookmark
⌥F3 Select file/folder/code line, use mnemonic to add/cancel bookmark
⌃0...⌃9 Navigate to the bookmark position of the corresponding value
⌘F3 show all bookmarks
Refactoring
F5 Copy files to the specified directory
F6 Move files to the specified directory
⌘⌫ To delete the file safely on the file, a confirmation box pops up
⇧F6 Rename file
⌘F6 Change signature
⌘⌥N consistency
⌘⌥M Extract the selected code as a method
⌘⌥V to extract variables
⌘⌥F Extract field
⌘⌥C Extract constant
⌘⌥P Extract parameters
VCS/Local History (version control/local history)
⌘K Submit code to the version controller
⌘T Update code from version controller
⌥⇧C View recent change history
⌃C Quick pop-up version controller operation panel
Live Templates (dynamic code templates)
⌘⌥J The template selection window pops up, and the selected code is wrapped in a dynamic template
⌘J Insert custom dynamic code template
General
⌘1...⌘9 Open the corresponding numbered tool window
⌘S save all
⌘⌥Y sync, refresh
⌃⌘F Switch to full screen mode
⌘⇧F12 Switch to maximize editor
⌥⇧F Add to favorites
⌥⇧I Check the current file and the current configuration file
§⌃, ⌃`
quickly switch the current scheme (switch theme, code style, etc.)
⌘, open IDEA system settings
⌘; Open the project structure dialog
⇧⌘A Search action (related options can be set)
⌃⇥ Switch between the editing window label and the tool window (if you press delete during the switching process, the corresponding selected window is closed)
Other (shortcut keys that are not reflected in some official documents)
⌘⇧8 Vertical editing mode
- navigation
⌘O Find class files Ctrl + N
⌘⌥O Go to the specified variable/method Ctrl + Shift + Alt + N
⌃← / ⌃→ Switch left and right to open the edit tab page Alt← / Alt→
⎋ Enter the code file window from the tool window ESC
⌘L Jump to the specified place of a certain line in the current file Ctrl + G
⌘E Display the list of recently opened files Ctrl + E
⌘⌥← / ⌘⌥→ Go back/forward to the previous operation Ctrl + Alt + ← Ctrl + Alt + →
⌘⇧⌫ Jump to the last edited place
⌃H Display the hierarchy of the current class Ctrl + H
⌘⇧H Display method hierarchy
⌃⌥H Display call hierarchy
F4 / ⌘↓ edit/view code source
⌘⌥U Display UML-like diagram
⌃J View notes
- edit
⌥⌦ Delete to the end of the word (⌦ key is Fn+Delete)
⌥⌫ Delete to the beginning of the word
⌘+ / ⌘- expand/collapse code block
⌘F1 Display specific description information at the error or warning
⌘⌥L format code
⌃⌥O optimize import
⇧↩ start a new line
⌘⇧↩ automatically end the code, automatically add a semicolon at the end of the line
⌃I Implementation method (implement method in interface)
⇧F6 Rename file or variable
⌘N, ⌃↩, ⌃N Generate code (getter, setter, constructor, hashCode/equals, toString)
⌘P Display method parameter information
- Find
Double⇧ find anything
⌘⇧F Global search (according to path)
⌘F Search in file
⌘G In search mode, search down
⌘⇧G In search mode, search upwards
⌘⌥B Jump to the implementation of the interface
⌘U View interface definition
⌘⌥← / ⌘⌥→ Back/forward to the previous operation
⌘B / ⌘ Click the mouse to enter the interface or definition of the method/variable where the cursor is located
⌃⇧B Jump to the type declaration
⌥ Space, ⌘Y Quickly open the definition of the method and class where the cursor is located
⌘O Find class files
⌘⇧O Find all types of files, open files, and open directories. To open a directory, you need to add a backslash/ before or after the input.
F12 Return to the 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 select file/folder/code line, add/cancel bookmark
⌥F3 Select file/folder/code line, use mnemonic to add/cancel bookmark
⌃0…⌃9 Locate the bookmark position corresponding to the value
⌘F3 show all bookmarks
⌥F1 displays the current file selection target pop-up layer, there are many targets in the pop-up layer to choose from (for example, you can select the Finder to display the file in the code editing window)
⌘F12 Pop up the current file structure layer, you can directly input on the pop-up layer to filter (can be used to search for methods in the class)
- Universal
⌃⌘F Switch to full screen mode
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。