Idea shortcut keys under Mac

IntelliJ IDEA For Mac Shortcuts

 

Mac keyboard symbols and modifier keys explained

  •  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)

1. Editing

  • ⌃Space Basic code completion (completing any class, method, variable)
  • ⌃⇧Space Smart code completion (filter method lists 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 documentation
  • ⇧F1 View external documentation (on some code it will trigger opening the browser to display the relevant documentation)
  • ⌘+鼠标放在代码上 Display code brief information
  • ⌘F1 Display specific descriptive information on errors or warnings
  • ⌘N, ⌃↩, ⌃N Generate code (getter, setter, constructor, hashCode/equals, toString)
  • ⌃O Override method (override parent class method)
  • ⌃I Implementing methods (implementing methods in an interface)
  • ⌘⌥T Surround code (use if..else, try..catch, for, synchronized, etc. to surround selected code)
  • ⌘/ Comment/Uncomment and Line Comments
  • ⌘⌥/ Comment/Uncomment and Block Comments
  • ⌥↑ Continuous selection of code blocks
  • ⌥↓ Decrease the currently selected code block
  • ⌃⇧Q Show contextual information
  • ⌥↩ Show intent actions and quick-fix code
  • ⌘⌥L format code
  • ⌃⌥O optimize import
  • ⌃⌥I auto indent line
  • ⇥ / ⇧⇥ Indent code / De-indent code
  • ⌘X Cut the current line or selected block to the 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 lines of the selected block
  • ⌃⇧J Intelligently splicing code into one line
  • ⌘↩ Smart split and spliced ​​lines
  • ⇧↩ start a new line
  • ⌘⇧U case switch
  • ⌘⇧] / ⌘⇧[ Select till end/begin of 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 all code blocks
  • ⌘⇧- Collapse all code blocks
  • ⌘W Close the active editor tab

2. Search/Replace (query/replace)

  • Double ⇧ query anything
  • ⌘F find within file
  • ⌘G In find mode, look down
  • ⌘⇧G In find mode, look up
  • ⌘R replace in file
  • ⌘⇧F Global lookup (by path)
  • ⌘⇧R Global replacement (based on path)
  • ⌘⇧S Query structure (for Ultimate Edition only, it needs to be set in Keymap)
  • ⌘⇧M Replacement structure (Ultimate Edition only, needs to be set in Keymap)

3. Usage Search (use query)

  • ⌥F7 / ⌘F7 Find usages in files / Find usages in classes
  • ⌘⇧F7 usage highlighted in the file
  • ⌘⌥F7 show usage

4. Compile and Run

  • ⌘F9 Compile Project
  • ⌘⇧F9 Compile the selected file, package or module
  • ⌃⌥R Pop up Run's selectable menu
  • ⌃⌥D Pop up the selectable menu of Debug
  • ⌃R run
  • ⌃D debugging
  • ⌃⇧R, ⌃⇧D Run context configuration from editor

5. Debugging

  • F8 Go to the next step, if the current line breakpoint is a method, do not enter the current method body
  • F7 Go to the next step, if the current line breakpoint is a method, enter the current method body, if the method body still has a method, it will not enter the embedded method
  • ⇧F7 Intelligent stepping, there are multiple method calls on the line where the breakpoint is located, and which method will be entered will pop up
  • ⇧F8 jump out
  • ⌥F9 Run to the cursor, if there is another breakpoint before the cursor, it will enter the breakpoint
  • ⌥F8 Evaluate expressions (variable values ​​can be changed to take effect)
  • ⌘⌥R Resume the program running, if there is a breakpoint in the code below the breakpoint, stop at the next breakpoint
  • ⌘F8 Switch breakpoints (if there is a breakpoint in the current line of the cursor, cancel the breakpoint, if not, add a breakpoint)
  • ⌘⇧F8 View breakpoint information

6. Navigation

  • ⌘O Find class files
  • ⌘⇧O Find all types of files, open files, open directories, open directories need to add a backslash before or after the input/
  • ⌘⌥O Go to the specified variable/method
  • ⌃← / ⌃→ Switch open editing tabs 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 the active run/messages/find/... tab
  • ⌘L Jump to the specified position of a line in the current file
  • ⌘E Display a list of recently opened file records
  • ⌘⌥← / ⌘⌥→ go back/forward to the place of the previous operation
  • ⌘⇧⌫ Jump to the last edited place
  • ⌥F1 Display 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
  • ⌘⌥B Jump to the implementation, use it on a called method name 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 type declaration
  • ⌘U Go 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 curly brace start/end position 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 Displays the current class hierarchy
  • ⌘⇧H Show method hierarchy
  • ⌃⌥H show call hierarchy
  • F2 / ⇧F2 Jump to next/previous location of highlighted error or warning
  • F4 / ⌘↓ Edit/View Code Source
  • ⌥ Home Display the navigation bar to the current file
  • F3Select file/folder/line of code, add/unbookmark
  • ⌥F3 Select file/folder/line of code, use mnemonic to add/unbookmark
  • ⌃0...⌃9 Locate the bookmark position of the corresponding value
  • ⌘F3 show all bookmarks

Seven, Refactoring (refactoring)

  • F5 Copy files to specified directory
  • F6 Move file to specified directory
  • ⌘⌫ On the file to delete the file safely, a confirmation box pops up
  • ⇧F6 rename file
  • ⌘F6 change signature
  • ⌘⌥N consistency
  • ⌘⌥M Extract the selected code as a method
  • ⌘⌥V Extract variables
  • ⌘⌥F Extract fields
  • ⌘⌥C Extract constants
  • ⌘⌥P Extract parameters

Eight, VCS/Local History (version control/local history)

  • ⌘K Commit code to version controller
  • ⌘T Update code from version controller
  • ⌥⇧C View recent change history
  • ⌃C Quick pop-up version controller operation panel

Nine, Live Templates (dynamic code template)

  • ⌘⌥J Pop up the template selection window, wrap the selected code with dynamic templates
  • ⌘J Insert custom dynamic code template

10. General

  • ⌘1...⌘9 Open the corresponding numbered tool window
  • ⌘S save all
  • ⌘⌥Y sync, refresh
  • ⌃⌘F Toggle full screen mode
  • ⌘⇧F12 Toggle maximized editor
  • ⌥⇧F Add to Favorites
  • ⌥⇧I Check the current file with the current configuration file
  • §⌃, ⌃` Quickly switch the current scheme (switch themes, code styles, etc.)
  • ⌘, Open IDEA system settings
  • ⌘; Open the project structure dialog
  • ⇧⌘A Find action (relevant options can be set)
  • ⌃⇥ Switch between editing window labels and tool windows (if you press delete during the switching process, it will close the corresponding selected window)

Eleven, Other (some shortcut keys not reflected in official documents)

  • ⌘⇧8 vertical edit mode

 

navigation

⌘O Find class files Ctrl + N

⌘⌥O Go to the specified variable/method Ctrl + Shift + Alt + N

⌃← / ⌃→ Switch open editing tabs left and right Alt← / Alt→

⎋ Enter the code file window ESC from the tool window

⌘L Jump to a specified line in the current file Ctrl + G

⌘E Display a list of recently opened file records Ctrl + E

⌘⌥← / ⌘⌥→ Go back/forward to the previous operation Ctrl + Alt + ← Ctrl + Alt + →

⌘⇧⌫ Jump to the last edited place

⌃H Show current class hierarchy Ctrl + H

⌘⇧H show method hierarchy

⌃⌥H show call hierarchy

F4 / ⌘↓ Edit/View code source

⌘⌥U Display class UML diagram

⌃J View Notes

edit

⌥⌦ delete to end of word (⌦ key is Fn+Delete) ⌥⌫
delete to beginning of word
⌘+ / ⌘- expand/collapse code block ⌥O Optimize import ⇧↩ Start a new line ⌘⇧↩ Automatically end the code, automatically add a semicolon at the end of the line ⌃I Implement a method (implement the method in the interface) ⇧F6 Rename a 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 (by path)
⌘F Find within file
⌘G In find mode, look down
⌘⇧G In find mode, look up

navigation

⌘⌥B Jump to the implementation of the interface
⌘U View the interface definition

⌘⌥← / ⌘⌥→ go 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 查找类文件
⌘⇧O 查找所有类型文件、打开文件、打开目录,打开目录需要在输入的内容前面或后面加一个反斜杠/

F12 返回到前一个工具窗口
⎋ 从工具窗口进入代码文件窗口
⇧⎋ 隐藏当前或最后一个活动的窗口,且光标进入代码文件窗口

F3选中文件/文件夹/代码行,添加/取消书签
⌥F3 选中文件/文件夹/代码行,使用助记符添加/取消书签
⌃0…⌃9 定位到对应数值的书签位置
⌘F3 显示所有书签

⌥F1 显示当前文件选择目标弹出层,弹出层中有很多目标可以进行选择(如在代码编辑窗口可以选择显示该文件的Finder)

⌘F12 弹出当前文件结构层,可以在弹出的层上直接输入进行筛选(可用于搜索类中的方法)

通用

⌃⌘F 切换全屏模式

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326103321&siteId=291194637
Recommended