Common Shortcut Keys for MAC
Command-T: Open a new tab.
Option-Command-Esc: Force quit the app.
Shift-Command-5: In macos Mojave or later, take a screenshot or record the screen.
Shift-Command-N: Create a new folder in the Finder.
Option-Command-D: Show or hide the Dock
Command+Delete: directly delete files, recoverable
Command+Option+Delete: Immediately delete the file, it cannot be recovered
Command+Shift+Delete: Empty the Trash
Home key = Command + left direction,
End key = Command + right direction,
PageUP=Command+up direction,
PageDOWN=Command+down direction,
Forward Delete=Fn+delete key,
Command+R: Refresh the web page
Pressing Shift+Control+Command+3 at the same time will take a screenshot of the entire screen in the clipboard;
Pressing Shift+Control+Command+4 at the same time will enable you to capture part of the screen by dragging the mouse and copy the picture to the clipboard.
Command+Option+C: Copy file path
1. Editing
⌃Space Basic code completion (completion of any class, method, variable)
⌃⇧Space smart code completion (filter method list and expected type of variable)
⌘⇧↩ 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)
⌘ + mouse on the code to display brief code information
⌘F1 Display detailed description information on errors or warnings
⌘N, ⌃↩, ⌃N generate code (getters, setters, constructors,
hashCode/equals,toString)
⌃O override method (override parent class method)
⌃I implement method (implement the method in the interface)
⌘⌥T surrounds the code (use if...else, try...catch, for, synchronized, etc. to surround the selected code)
⌘/comment/uncomment with line comments
⌘⌥/comment/uncomment and block comment
⌥↑ Continuously select code blocks
⌥↓ Reduce the currently selected code block
⌃⇧Q Display context information
⌥↩ Show intent actions and quick-fix codes
⌘⌥L format code
⌃⌥O optimize import
⌃⌥I auto-indent line
⇥ / ⇧⇥ indented code / unindented code
⌘X cut current line or selected block to clipboard
⌘C copy current line or selected block to clipboard
⌘V paste from clipboard
⌘⇧V paste from the nearest buffer
⌘D Duplicate current line or selected block
⌘⌫ delete the current line or the line of the selected block
⌃⇧J Intelligently splicing code into one line
⌘↩ intelligently split concatenated lines
⇧↩ start a new line
⌘⇧U switch case
⌘⇧] / ⌘⇧ select until code block end/begin
⌥⌦ Delete to the end of the word (⌦ key is Fn+Delete)
⌥⌫ delete to the beginning of the word
⌘+ / ⌘- expand/collapse code blocks
⌘⇧+ Expand all code blocks
⌘⇧ - collapse all code blocks
⌘W closes the active editor tab
Two, Search/Replace (query/replace)
Double ⇧ query for anything
⌘F Find in file
⌘G Find mode, find down
⌘⇧G In search mode, search up
⌘R In-file replace
⌘⇧F global lookup (by path)
⌘⇧R global replace (according to path)
⌘⇧S query structure (for Ultimate Edition only, needs to be set in Keymap)
⌘⇧M Replace structure (only for Ultimate Edition, need to be set in Keymap)
3. Usage Search (use query)
⌥F7 / ⌘F7 Find Usages in Files / Find Usages in Classes
Usage of ⌘⇧F7 for highlighting in files
⌘⌥F7 show usage
Four, Compile and Run (compile and run)
⌘F9 Compile Project
⌘⇧F9 compile selected files, packages or modules
⌃⌥R pops up the optional menu of Run
⌃⌥D pops up the optional menu of Debug
⌃R run
⌃D debugging Author: zgcdboy https://www.bilibili.com/read/cv17498224 Source: bilibili
pwd list current path
cmd + option + ← (after entering the method) to return to the previous call