Mac 快捷键

天下武功,唯快不破。

Simple & Less

  • 正确的做法:
    • 选用符合直觉的好设计 —— 它们容易习惯,不容易被错误地使用。
      • 「开箱即用」默认的配置就能用得顺手,这是一个很高的标准。
    • 根据「二八法则」(帕累托法则)只做关键部分的改进,用更少的工具完成更多的事情。
      • 工具提供适当足够的设置选项,然后将工具配置得足够贴合个人的使用习惯。
        例如,尽量使用默认通用的快捷键;同时使用多个 IDE 和代码编辑器的话,尽量将快捷键配置得一样,增强快捷键的通用性,减轻记忆快捷键的负担,减少误用;建议尽量都使用 Vim 插件,统一以 Vim 方式进行操作,可以进一步减轻记忆负担,增加操作效率。

Explanation

  • Here are the Mac shortcuts:
    • the default ones that I use most frequently,
    • my custom ones.
    • I hide the default shortcuts that are seldom used.
  • Meanings of Font Format:
    • The item with the superscript custom  implies it might be custom by me.
    • _The italic item is not frequently-used.
  • My Related Articles :
  • Reference :

Key Symbols

Power
Command ( Cmd )
Option | Alt
^ Control | Ctrl
Shift ( Shf )
CapsLock
Tab
Escape ( Esc )
Return ( Ret ) | Enter
Space

Up
Down ( Dn )
Left ( Lf )
Right ( Rg )

Delete ( Del ) | Backspace

0~9 One of the digits 0 ~ 9
a~z One of the alphabet a ~ z

Abbreviations

  • Buttons
    Cmd Command
    Ctrl Control
    Esc Escape
    Opt Option
    Ret Return
    Shf Shift
    Del Delete
  • Directions & Positions
    Dn Down
    Lf left
    Rg Right
    Prev Previous
    Btm Bottom
  • Words
    App Application
    Dir Directory
    Mv Move
    Rm Remove
    Str String
    Pf Prefix
  • Symbols
    & And
    | Or
  • Others
    aka Also known as

Examples

  • Meaning of Font Style
    Italic : I seldom use it .
    custom : Added | modified by myself .
  • ⌘ ⌥ a Manipulation
    Press “Cmd”, “Opt” & “a” at the same time to do the manipulation .
  • A Manipulation
  • ⇧ A Manipulation
    The capital letter “A” means pressing “Shf” & “a” at the same time !
  • ⌘ 1 | ⌘ 2 Manipulation
    Press “⌘ 1” or “⌘ 2” to do the manipulation.
  • ⌘ 1, ⌘ 2 Manipulation
    Press “⌘ 1” then “⌘ 2” to do the manipulation.

macOS

  • Some are common & default in operating system.
  • Some of the keys below can be modified in System Preference → Keyboard.
  • Some are modified by Apps Karabiner-Elements & Keyboard Maestro.

System

  • Power
    Wake Up
    ⌘ ⌥  Sleep
    ^ ⇧  | ⌘ ^  Display Sleep

    ^  Shut Down
    ( Then you can choose to Sleep or Restart in the prompt dialog box. )
    ⌘ ^  Force Restart
    ⌘ ^ ⌥  Force Shutdown

  • Accessory
    F1 Desktop custom
    ⌘ 凵 Spotlight
    ⌥ ⇧ F Search in All Files custom
    ⌥ ⇧ ? Show Help Menu custom

  • Dock & Menubar & Sidebar
    F12 Open Notification Center custom
    ^ F12 Do Not Disturb On/Off custom
    ⌘ ⌥ d Dock Hiding On/Off

  • Screenshot
    ⌘ ⇧ 3 Capture Desktop
    ⌘ ⇧ 4 Capture the selected area
    ( The screenshots are saved in ~/Desktop. )

Finder

  • File
    ⌘ ↓ Open
    ⌘ d Duplicate
    ⌘ e Eject Disk

    ⌘ l New Alias for a file
    ⌘ r to Origin File of Alias

  • Folder
    ⌘ ⇧ A Application
    ⌘ ⇧ D Desktop
    ⌘ ⇧ F All My Files
    ⌘ ⇧ G to Folder
    ⌘ ⇧ I iCloud
    ⌘ ⇧ O Documents
    ⌘ ⇧ R AirDrop
    ⌘ ⌥ l Downloads

    ⌘ ⇧ N New Folder
    ⌘ ↑ to Parent Dir
    ⌘ ^ ↑ Open Parent Dir in New Window

    ⌘ ⇧ C Computer
    ⌘ ⇧ H Home
    ⌘ ⇧ K Network
    ⌘ ⇧ U Utilities

  • View
    Quick Look
    ⌘ i Get Info
    ⌘ ⇧ . Show Hidden Files

    ⌘ 1 View the files in way of Icon
    ⌘ 2 View as a List
    ⌘ 3 View as columns
    ⌘ 4 View as a cover flow

    ⌘ ⇧ ⌫ Empty Trash
    ⌘ ⇧ ⌥ ⌫ Empty Trash without Confirmation

    ⌘ ⇧ P Show | Hide Preview
    ⌘ ⌥ p Show | Hide Path Bar
    ⌘ ⌥ s Show | Hide Sidebar
    ⌘ ⌥ t Show | Hide Tool Bar
    ⌘ / Show | Hide Status Bar

File & Edit

  • File
    ⌘ n New
    ⌘ o Open
    ⌘ s Save
    ⌘ p Print
    ⌘ ⇧ S Save as

  • Edit
    ⌘ z Undo
    ⌘ ⇧ Z Redo

    ⌘ a Select All
    ⌘ c Copy
    ⌘ ⌥ c Copy Path

    ⌘ v Paste
    ⌘ ⌥ v Move ( After ⌘ c )

    ⌘ f Search
    ⌘ g Next Match
    ⌘ ⇧ G Prev Match

    ⌥ ← Prev Word
    ⌥ → Next Word

    After text selection, then input:
    ⌘ b Bold
    ⌘ u Underline
    ⌘ i Italic
    ⌘ + Bigger | Zoom In
    ⌘ - Smaller | Zoom Out

Window & Tab

  • Window
    ⌘ ` Switch windows of the current App
    It’s enhanced by App HyperSwitch | Keyboard Maestro

    ⌘ ^ f Toggle Full Screen
    ⌘ , Preferences
    ⌘ q Exit
    ⌘ w Close

    ⌘ h Hide
    ⌘ ⌥ h Hide All Apps But the Front-most
    The manipulation Hide is much better than Minimize in macOS!
    So I prefer Hide to Minimize.

    ⌘ m Minimize to Dock
    ⌘ ⌥ m Minimize All Windows of the Front-most App

  • Tab
    ⌘ r Refresh
    ⌘ t New Tab
    ⌘ 0~9 Select Tab
    ( If there are more than 9 tabs, ⌘ 9 will select the last one. )

    ^ ⇥ Next Tab
    ^ ⇧ ⇥ Prev Tab
    ⌘ ⇥ Next App
    ⌘ ⇧ ⇥ Prev App

    ⌘ [ Backward
    ⌘ ] Forward

Input Sources

  • Select
    ⌥ 凵 Switch Input Sources custom
    ⌘ ^ 凵 Emoji & Symbols

    Caps : Switch Chinese Input Source custom
    Shf | Esc : Press Shf or Esc to Switch English Input Source, when using Chinese input source custom
    ( for the convenience of the Vim users when using Chinese input sources. )

  • Pinyin - Simplified (macOS built-in)
    [ Page Up
    ] Page Down
    Sort By
    0~9 Select
    ^ ⇧ 凵 Trackpad Handwriting

  • Baidu Input Now I use
    ^ t [ Simple | Traditional ] Chinese Characters
    ^ . [ Chinese | English ] Punctuation Marks
    ⇧ 凵 [ 全角 | 半角 ] Punctuation Mark Types
    ^ p [ 全拼 | 双拼 ] Chinese Input Modes
    ⌥ ⇧ B Emoji & Symbols
    ⌥ ⇧ 凵 Add a space between Chinese & English

Emacs Mode

A few people know that it’s supported in by default in macOS.
They may work, if you append some modifier keys to them.

  • Default
    ^ f =
    ^ b =
    ^ p =
    ^ n =
    ^ a = ⌘ ← Home
    ^ e = ⌘ → End

    ^ h = Del
    ^ d = Fn ⌫ Forward Del
    ^ k Del to the End of the Line
    ^ t Exchange the Charactors before & after the cursor
    ^ o Insert a Blank Line '\n' after the cursor

    They are also enabled by Zsh ( in .zshrc ) and Vim ( in .vimrc ) in iTerm 2 ( Terminal ).

  • Moreover modified by Keyboard Maestro
    ^ p = ⌥ ← Move to Prev Word custom
    ^ n = ⌥ ← Move to Next Word custom
    ^ w = ⌥ ⌫ Del Preceding Word custom
    ^ u = [ ^ a, ^ k ] Del the Whole Line custom
    ^ j = Return custom

    These modifications can be supported in Karabiner-Elements too.

  • Ref : Keyboard Shortcuts ( Emacs ) for Editing Text Fields in OS X

Activity Monitor

⌘ ⌥ f Filter Processes
⌘ ⌥ q Quit the selected Process

Mail

⌘ ^ s custom | ⌘ ⇧ N default Get All New Mail

⌘ r Reply
⌘ ⇧ r Reply All
⌘ ⇧ f Forward
⌘ ⇧ L Red Flag_
⌘ ⌥ f Mailbox Search

⌘ 1 Inbox
⌘ 2 Sent
⌘ 3 Drafts

Crazy Remappings

Keyboard Maestro

  • Global Macro
    ⌘ ^ ⇧ O Toggle All Micro

  • Search in Web
    ⌘ ^ ⇧ A Amazon
    ⌘ ^ ⇧ B Baidu
    ⌘ ^ ⇧ D Douban
    ⌘ ^ ⇧ G Google
    ⌘ ^ ⇧ J JD.com
    ⌘ ^ ⇧ M Tmall
    ⌘ ^ ⇧ T Taobao
    ⌘ ^ ⇧ W Weibo
    ⌘ ^ ⇧ Z Zhihu

  • Abbrs
    Regular : Type |[a-zA-Z0-9]+ | [a-zA-Z0-9]+| → Extend | Rewrite …
    For examples :

    • Dates
      Type string |hm, it will be replaced by the time string hh:mm
      Type |ymd, replaced by yy/MM/dd
      |yymdYYYY-MM-dd
      |yy/mdYYYY/MM/dd
      |yy.mdYYYY.MM.dd

    • Symbols
      |up
      |dn
      |lf
      |rg
      |tab
      |shf
      |opt
      |cmd
      |ret

    • Words
      |httpHTTP
      |latexLaTeX
      |dbdatabase
      |rmremove
      desc|description
      env|environment

    • Commands
      |vhsudo vim /etc/hosts
      |vpsudo vim /etc/php.ini
      |snrsudo service nginx restart
      |sprsudo service php-fpm restart

    • Links
      |bloghttps://icehe.me

    • Mails
      |qm666@qq.com

    • Numbers
      |127127.0.0.1

Karabiner-Elements

Changes not only the shortcuts but also the keyboard key-remappings!

  • Quit
    ⌘ q, ⌘ q Double tap ⌘ q to send one real keystroke ⌘ q

  • Prefix Key ⌥ ⇥
    It’s used to prevent you from launching the unwanted App when pressing its shortcut by accident.
    Only when you pressed Pf Key at first and then the App shortcut, did it launch.

  • Change Modifier-Key-Remapping
    Rg Cmd → Esc
    Caps → ^ Lf Ctrl
    ^ Lf Ctrl → Caps

  • Functional Keys
    Functional KeysF1 ~ F12
    Fn + Functional KeysFunctional Keys

  • Input Sources ( abbr : IS )

    • Caps ( current pos is Lf ^ ) → to Chinese Input Source
      How to implement:
      App Karabiner-Elements : Caps → F19
      App Keyboard Maestro : F19 → to Chinese IS ( Ref )

    • Shf | Esc → English Input Source
      Press Shf or Esc alone to switch English IS, when using Chinese IS.
      ( for the convenience of the Vim users when using Chinese IS. )
      How to implement:
      App Karabiner : Press Lf Rg , Rg , alone will trigger F18
      App Keyboard Maestro : F18 → to US English IS

    • How to switch two input sources stably?
      ( I cannot find a stable method to switch IS if more than 2 ISs exist on macOS. )
      ( Stable : Your operation always work. >99% )
      There must be only two active ISs on macOS.
      Keyboard Maestro ( abbr : KM ) gets current input source via shell command inputsource ( Ref ).

      For example, press Caps ( current pos is Lf ^ ) :
      if result of command inputsource does not match com.baidu.inputmethod.BaiduIM.pinyin,
      KM will trigger keystroke ⌥ 凵 to switch to IS Baidu Input or else.

      Press Shf or Esc alone when using Chinese Input :
      if result of command inputsource does not matches com.apple.keylayout.US,
      KM will trigger keystroke ⌥ 凵 to switch to IS English Layout or else.

App Switcher

  • or else

Layout

  • 0123 …
    凵 1 iTerm2
    凵 2 2Do
    凵 3 Sublime Text
    凵 4 Chrome
    凵 5 Safari
    凵 7 Keyboard Maestro
    凵 8 Karabiner-Elements

  • asdf …
    凵 asdfghjkl; = 1234567890

  • Symbols
    凵 ` = ⇧ ` = ~
    凵 - = ⇧ - = _
    凵 = = ⇧ = = +
    凵 [ = ⇧ [ = {
    凵 ] = ⇧ ] = }
    凵 \ = ⇧ \ = |
    凵 ' = ⇧ ' = "

Layout ^

  • 1234 …
    ⌥ ` 1Password
    ⌥ 1 Script Editor ( AppleScript )
    ⌥ 2 System Preferences
    ⌥ 3 Notes

  • qwer …
    ⌥ q QQ
    ⌥ w WeChat
    ⌥ e Mail
    ⌥ r Preview
    ⌥ t Thunder

    ⌥ i Prompt the local IP address
    ⌥ p Postman
    ⌥ \ 1Password ( Mini )

    ⌥ ⇧ W Word
    ⌥ ⇧ T Type String ( in clipboard ) inseted of Paste
    ⌥ ⇧ P PowerPoint
    ⌥ ⇧ E Evernote
    ^ ⌥ ⇧ E Excel
    ⌥ ⇧ I iTunes

  • asdf …
    ⌥ a Activity Monitor
    ⌥ s PhpStorm
    ⌥ d EuDic
    ⌥ f Finder
    ⌥ g Acrobat Reader ( PDF )

    ⌥ h Photos
    ⌥ j IntelliJ IDEA
    ⌥ k Numi ( Calculator )
    ⌥ l CLion
    ⌥ ; Input the symbol

    ⌥ ⇧ A PyCharm
    ^ ⌥ ⇧ A App Store
    ⌥ ⇧ S Sequel Pro ( MySQL )
    ⌥ ⇧ D Dictionary
    ⌥ ⇧ F Search in All Files
    ⌥ ⇧ J Eject the disks
    ⌥ ⇧ K Calculator

  • zxcv …
    ⌥ x Xiami Music
    ⌥ c Charles
    ⌥ v ClipMenu - Clipboard History
    ⌥ b MindNode ( b for Brainstorm )
    ⌥ n NeteaseMusic
    ⌥ m Messages

    ⌥ ⇧ C Calendar
    ⌥ ⇧ V ClipMenu - Snippets
    ^ ⌥ ⇧ V ClipMenu - Main Menu
    ⌥ ⇧ B System Settings → BlueTooth
    ⌥ ⇧ M Send Clipboard to iPhone by Messages
    ⌥ ⇧ N System Settings → Network

Layout Fn

  • Arrange the windows
    Aka Resize & Move the windows. ( Frequently Used )
    These features can be supported by Moom | Spectacle | Keyboard maestro.

    Fn d Lf 1/2
    Fn f Rg 1/2
    Fn e Lf 3/5
    Fn r Rg 3/5

    Fn g Fit to Desktop
    Fn t Fit to Center 1/2

    Fn q Top Lf 1/4
    Fn w Top Rg 1/4
    Fn a Btm Lf 1/4
    Fn s Btm Rg 1/4

  • Direction Keys
    They’re Vim-like.
    Fn h = Lf
    Fn j = Dn
    Fn k = Up
    Fn l = Rg

  • Others
    Fn u =

Layout

  • qwer …
    ⎋ q QQMail
    ⎋ w Weibo
    ⎋ e Official ERP
    ⎋ r Redmine
    ⎋ t GitLab Proj Tags

    ⎋ i GitLab Proj Issue Board
    ⎋ o GitLab Proj Contributors
    ⎋ p PHP.net
    ⎋ [ | ⎋ ] GitLab Projs’ Pipelines

  • asdf …
    ⎋ a GitLab Proj Branches
    ⎋ s | ⎋ v GitLab Projs’ Repositories
    ⎋ d | ⎋ f GitLab Projs’ Merge Requests
    ⎋ g Google

    ⎋ h GitHub
    ⎋ j Jenkins
    ⎋ k Kibana
    ⎋ l localhost:4000

  • zxcv …
    ⎋ z GitLab User Profile
    ⎋ x Open Link ( in clipboard ) in Safari
    ⎋ c Open Link ( in clipboard ) in Chrome
    ⎋ b Baidu
    ⎋ n GitLab Proj Issue List
    ⎋ m IceHe.me

System Assistant

1Password

⌘ \ Fill Login on current web page
⌥ \ Show 1Password Mini

⌘ e Edit
⌘ s Save

Amphetamine

⌥ F12 Mac Stays Awake
^ ⌥ F12 Allow Mac to Sleep

CheatSheet

Long Press ⌘ Show Tips

ClipMenu

⌥ v History
⌥ ⇧ V Snippets
^ ⌥ ⇧ V Main Menu

ShadowsocksX-NG

^ ⌥ p Toggle Proxy Mode: Auto PAC / Global
^ ⌥ ⇧ S Toggle Shadowsocks On / Off

Development

PhpStorm

  • References
    Quick Guide : PhpStormHelpKeymap Reference
    Advance Settings : PhpStormPreferences…Keymap

  • Refactor
    ^ ⌥ t Refactor This
    ^ ⌥ o Optimize Imports

    ⌘ ⌥ l Reformat Code
    The rules for reformation can be modified in :
    PreferencesEditorCode Style → Select the programming language.

    ⌘ ⌥ e Rename $variableName, ClassName, functionName ( Auto rename other related code )
    ⌘ ⌥ n Inline Variable
    ⌘ ⌥ v Extract Variable
    ⌘ ⌥ m Extract Method
    ⌘ ⌥ f Extract Field
    ⌘ ⌥ c Extract Constant
    F5 Copy File
    F6 Move File

  • Code
    ^ 凵 Auto Complete

    ⌘ / Line Comment
    ⌘ ⌥ / Block Comment

    ⌥ ↑ Extend Selection
    ⌥ ↓ Shrink Selection

    ⌥ ↩ Show Intention Actions
    ⌘ ⇧ ↩ Complete Current Statement

    ^ ⌥ h Toggle Parameter Name
    ^ ⌘ g Select All Occurrences
    ^ ⇧ I Inspect Code

  • Debug
    ^ ⇧ B Toggle Line BreakPoint
    ^ ⇧ E Edit BreakPoint ( Break if conditional is true)
    ^ ⇧ V View BreakPoints
    ^ ⇧ W Add to Watches
    ^ ⌥ w Add to Watches

    ^ ⇧ R Run…
    ^ ⇧ A Rerun
    ^ ⇧ D Debug
    ^ ⇧ S Stop

    ^ ⇧ I Step Into
    ^ ⇧ O Step Out

    ^ ⇧ N Resume Program ( Next BreakPoint )
    ^ ⇧ J Step Over ( Next Line )

  • File
    ⌘ ⇧ C Copy Path
    ^ ⌥ r Copy Reference ( File:Line | Class::method() )
    ⇧ ↩ Open in a new Editor Window ( in Project View)

  • Find
    ⌘ f Find
    ⌘ ⇧ F Find in Paths
    ⌘ r Replace
    ⌘ ⇧ R Replace in Paths
    ⌘ g Find Next
    ⌘ ⇧ G Find Prev

    ^ ⌥ g Toggle Regex
    ^ ⌥ c Toggle Case Sensitive

    ^ g Find Usage
    ⌘ o Find Class
    ⌘ ⇧ O Find File
    ⌘ ⌥ o Find Symbols ( Class, Files, Methods, Functions )

  • Navigate
    F2 Next Highlighted Error
    ⇧ F2 Prev Highlighted Error
    ⌥ F1 Select current file or symbol in any view

    ⌘ j Next Method
    ⌘ k Prev Method

    ⌘ e Recent Files
    ⌘ ⇧ E Recently Edited Files

    ⌘ ⇧ T Test Subject : Jump to Test for current file | Create Test for it
    ⌘ u Super Class or Interface
    ⌘ ↑ Navigation Bar

    ⌘ 1~9 Jump to the specified Tool Window | Hide it
    ⌘ 1 Project
    ⌘ 2 Favorites ( Projects, Bookmarks, Breakpoints )
    ⌘ 3 Find
    ⌘ 4 Debug

    ⌘ 9 Version Control

    ^ m Toggle Bookmark
    ^ ⌥ m View Bookmarks
    ^ ⌥ j Next Bookmark
    ^ ⌥ k Prev Bookmark

    ⌘ 6 Todo
    ⌘ 7 Structure

  • VCS: History & Compare
    ^ ⌥ l Local History -> Show History
    ^ ⌥ a Git -> Annotate
    ^ ⌥ v Git -> Compare with the Same Repository Version

    ^ ⌥ b Git -> Compare with Branch …
    ^ ⌥ . Git -> Compare with …
    ^ ⌥ c Git -> Resolve Conflicts

    ⌘ t Update Porject from VCS
    ^ ⇧ C Commit Project to VCS
    ⌘ ⌥ g ‘VCS’ Operations Quick Popup

  • Tools
    ⌘ ^ h Hide All Tool Windows
    ^ ⌥ q Terminal
    ^ ⌥ s Test RESTful Web Service

    ⌘ ⇧ ↑↓←→ Extend | Shrink Tool Window

IdeaVim

It is the best Vim-Emulator plugin for IDEs from JetBrains.
Its most keys are the same as Vim, so I just list my custom keys.
My config file .ideavimrc

  • Ctags Like
    ^ ] Find Declaration
    ^ t Back from Declaration

  • Tab
    H Prev Tab
    L Next Tab

    , Leader Key
    , a = 1gt
    , s = 2gt
    … d f g h j k …
    , l = 9gt
    , ; = 10gt
    , 1 = 11gt
    , 2 = 12gt

    , 9 = 19gt
    , 0 = 20gt

  • Mimic Emacs in Insert Mode:
    ^ b =
    ^ f =
    ^ p Forward Word
    ^ n Backward Word

    ^ a = Home
    ^ e = End

    ^ k Del to End of Line
    ^ u Del to Head of Line
    ^ t Exchange Chars ( Before & After Cursor )

  • Vim-Surround
    ds* Delete Surround
    such as ds' ds" ds[ ds{ ds` dst ( t for HTML Tag ) …

    ys** Add Surround :
    1st * for Postion ( Start or Stop )
    2rd * for Surround Char (or HTML Tag)
    such as yse' ysW" ysfb[ ysTh{

    cs** Change Surround
    1st * for Current Surround Char
    2rd * for New Surround Char
    such as cs'" cs[{ cst<p>

  • Others
    ^ r = :redo<CR> Redo
    ⇧ K = Jx Join curren line and next line without breaking concated spacing

JetBrains

The shortcuts in other IDEs from JetBrains are same as PhpStorm,
such as CLion , IntelliJ IDEA , RubyMine , PyCharm and so on.
All the shortcuts can be modified in PreferencesKeymap!

Sublime Text

  • Cursor Position
    ^ i Jump Forward
    ^ o Jump Backword

  • Find & Replace
    ⌘ f Find
    ⌥ ↩ Find All
    ⌘ r Find Files

    ⌘ ⌥ f Replace
    ⌘ ⌥ e Replace one by one
    ^ ⌥ ↩ Replace All

    ⌘ ⌥ r Toggle Regular Expression
    ⌘ ⌥ c Toggle Case Sensitive

  • Selection
    ⌘ d Expand Selection to Word
    ^ ⇧ M Expand Selection to Brackets
    ⌘ ⇧ L Split into Lines

  • Layout
    ⌘ ⌥ 1~4 1~4 Columns
    ⌘ ⌥ 5 Grid
    ⌘ ⌥ ⇧ 2~3 2~3 Rows

  • Command Palette…
    ⌘ p Quick Open File
    ⌘ ⇧ P Command Palette…
    ⌘ ⇧ C Copy File Path
    ^ s Trim Trailing Whitespace

  • Sidebar
    ⌘ k ⌘ b Toggle Sidebar

Charles

  • Proxy
    ⌘ r [ Start | Stop ] Recording
    ⌘ t Start | Stop Throttling
    ⌘ k Enable | Disable Breakpoints

    ⌘ ⇧ t Throttle Settings
    ⌘ ⇧ k Breakpoint Settings
    ⌘ ⇧ p macOS Proxy

  • Session
    ⌘ ⌫ Clear
    ⌘ o Open
    ⌘ n New
    ⌘ s Save Request
    ⌘ ⇧ s Save As …

  • View
    ⌘ 1 Overview
    ⌘ 2 Request
    ⌘ 3 Response
    ⌘ 0 Sequence
    ⌘ 9 Structure
    ⌘ ⇧ H Focused Hosts
  • Tools
    ⌘ ⇧ R Repeat
    ⌘ ⇧ D DNS Spoofing Settings custom
    ⌘ ⌥ m Map Remote

    ⌘ m Compose ( Modify )
    ⌘ ⇧ M Compose New

    ⌘ ⌥ l Map Local
    ⌘ ⌥ d No Caching
    ⌘ ⌥ c Block Cookies

    ⌘ ⌥ r Rewrite
    ⌘ ⌥ b Black List
    ⌘ ⌥ w White List

    ⌘ ⌥ i Mirror
    ⌘ ⌥ a Rewrite

Script Editor

⌘ ⇧ O Open Dictionary
⌘ r Run the script
⌘ . Stop the script

CLI

iTerm2

Due to the help from tmux and Zsh, I don’t need much support from iTerm as follows.
⌘ 0~9 Switch Tab

tmux

More details in Official Docs.
My config file .tmux.conf

^ q Prefix Key ( aka Pf )
The description Pf, * implies that tap Pf at first and then tap the key *.

Pf, ⇧ ? List Keys
Pf, d Detach Client
Pf, c New Window
Pf, s Reload config file .tmux.conf

Pf, \ Split Window Horizontally
Pf, - Split Window Vertically

Pf, ^ y Resize Pane Lf
Pf, ^ u Resize Pane Dn
Pf, ^ i Resize Pane Up
Pf, ^ o Resize Pane Rg

Pf, h Select Lf Pane
Pf, j Select Dn Pane
Pf, k Select Up Pane
Pf, l Select Rg Pane

Pf, ↑ Maximize Current Pane in New Window
Pf, ↓ Put Current Pane back to its Parent Window

Pf, [ Use Vim-like keys to copy str at Copy Mode

In Copy Mode:
v Begin Selection
y Copy Selection
u Copy Selection & Exit Copy Mode
⇧ L Copy Line ( & Exit Copy Mode )

Vim

Only list the useful keys that I’m unfamiliar with here.
My config file .vimrc

  • Mv Cursor
    ^ o | ^ i [ Prev | Next ] Cursor Pos
    { | } [ Prev | Next ] Blank Line

    w | ⇧ W Head of Next [ Word / Str ]
    e | ⇧ E Tail of Next [ Word / Str ]

    b | ⇧ B Head of Prev [ Word / Str ]
    ge | gE Tail of Prev [ Word / Str ]

    ; Repeat the last manipulation about f t ⇧ F ⇧ T
    0 Head of Line
    ^ = ⇧ 6 Head of Line ( Non-Whitespace )
    $ = ⇧ 4 End of Line

    " Switch to some Register
    - Head of Prev Line
    ⇧ + Head of Next Line

  • Select Range
    ciw Del Word
    caw Del Word including the Following Spaces 凵

    dw Del until Head of Next Word
    de Del to End of Cur Word

    ci* Select & Manipulate the string surrounded by *.
    ca* Select & Manipulate the string surrounded by * including *.

  • Column Edit Mode
    Example :

    1. In normal mode ^ v then select a block area
    2. ⇧ I then type some string to insert
    3. , ( Twice ) to apply the insertion at each line heading of the selected block area
  • Command
    . Repeat Command

  • Cp & Join
    ⇧ Y Copy from the cursor to the end of line
    ⇧ K Join curren line and next line without breaking

  • Del
    x Del Char Forward ⌦
    ⇧ X Del Char Backward ⌫

    s Del Char Forward & then Insert
    ⇧ S Del Current Line & then Insert
    ⇧ C Del to End of Line & then Insert
    ⇧ D Del to End of Line

  • Exchange
    xp Exchange the Current Char and the Next Char
    ddp Exchange the Current Line and the Next Line

  • Lower or Upper Case
    ⇧ ~ Toggle Case & Mv Cursor to Next char
    u to Lowercase
    ⇧ U to Uppercase

  • Increase or Decrease Num
    In Normal Mode:
    ^ a Increase Num
    ^ x Decrease Num

  • Macro
    q a~z|A~Z Start Recording Macro marked as a~z|A~Z
    q Stop Recording
    @ a~z|A~Z Play Macro marked as a~z|A~Z
    @@ Repeat Macro that you last used

  • Check Encoding Value
    ga Show ASCII of Char
    g8 Goto UTF-8 of Char

  • Open Path
    gf Open Path where cursor is

  • Save & Quit
    ^ s = :w Save ( valid in both Insert & Normal Mode )
    ⇧ ZZ Save & Quit
    ⇧ ZQ Quit without Saving

  • CTags ( plugin )
    ^ ] Find Declaration
    ^ t Back from Declaration

  • Mimic Emacs in Insert Mode
    ^ b =
    ^ f =
    ^ p =
    ^ n =

    ^ a = Home
    ^ e = End

    ^ k Del to End of Line
    ^ u Del to Head of Line
    ^ t Exchange Chars ( Before & After Cursor )

  • Window
    ^w, n = :new<CR> New Horizontal Split ( editing new empty buffer )
    ^w, s = :split<CR> Split Window Horizontally ( editing current buffer )
    ^w, v = :vsplit<CR> Split Window Vertically ( editing current buffer )
    ^w, c = :close<CR> Close Window
    ^w, o = :only<CR> Close All Windows But only the Current

    ^w, w Go to Next window
    ^w, p Go to Prev window
    ^w, Go to window Above
    ^w, Go to window Below
    ^w, Go to window on Left
    ^w, Go to window on Right

  • Tab
    :tabedit [path/to/file]<CR> Open Existing File in New Tab
    ,, t = :tabedit<space>
    :edit [path/to/file]<CR> Open Existing File in Current Tab
    ,, e = :edit<space>

    :tabnew<CR> Open New Empty Tab
    :tabc<CR> Close Current Tab
    :tabo<CR> Close all Other Tabs But only the Current

    L = gt = :tabn<CR> Next Tab
    H = gT = :tabp<CR> Prev Tab

    ,, a = 1gt to Tab 1
    ,, s = 2gt to Tab 2
    … d f g h j k …
    ,, l = 9gt to Tab 9
    ,, ; = 10gt to Tab 10
    ,, 1 = 11gt to Tab 11
    ,, 2 = 12gt to Tab 12

    ,, 9 = 19gt to Tab 19
    ,, 0 = 20gt to Tab 20

    ,, W = :tabm<space>-1<CR> Move Tab Left
    ,, E = :tabm<space>+1<CR> Move Tab Right

  • Comment
    ,, ; = ^i;<Esc> Comment "
    ,, ' = ^i"<Esc> Comment "
    ,, # = ^i#<Esc> Comment #
    ,, / = ^i//<Esc> Comment //
    ,, ? = ^xx<Esc> Revert Comment //
    ,, ! = ^i<!-- <Esc>$a --><Esc> Comment <!-- … -->
    ,, > = ^xxxxx$xxxx Revert Comment <!-- … -->

  • Search & Replace
    • :%s/search_str/replace_str/gci
      • : switch to Command Mode
      • % find each occurence of search_str
      • s replace operation
      • g replace globally
      • c ask for confirmation
      • i case insensitive , I case sensitive
    • :'<,'>s/foo/bar/g
      • '<,'> replace within a visual selection (when compiled with +visual)
    • :5,12$/foo/bar/g
      • 5 , 12 start from line 5 to the line 12
    • :.,$/foo/bar/g
      • . , $ start from the current line to the last line
    • :.,+2s/foo/bar/g
      • . , +2 start from the current line to the next two lines
    • :'a,'bs/foo/bar/g
      • 'a , 'b start from the mark a to the mark b
    • :g/^baz/s/foo/bar/g
      • Change each ‘foo’ to ‘bar’ in each line starting with ‘baz’
    • Ref : Search and replace & Vim 字符串替换及小技巧
  • Others
    ,, h = :set noh<CR> Deactivate Highlighted
    ,, n = :set nu!<CR> Toggle Absolute Line Number
    ,, r = :set rnu!<CR> Toggle Relative Line Number

Zsh

My config file .zshrc

  • Emacs Mode
    ^ a Mv Cursor to Head of Line
    ^ e Mv Cursor to End of Line

    ^ w Del Word
    ^ k Del to End of Line
    ^ u Del Line

    ^ p Backward Word ^ n Forward Word

    ^ f Mv Cursor Rg ( I use Fn l instead. )
    ^ b Mv Cursor Lf ( I use Fn h instead. )

    ^ h Del Backward ⌫ ( I used to use . )
    ^ d Del Forward ⌦ ( seldom used )

    ^ l Clear Screen

  • Extra
    ^ _ Undo
    ^ y Yank

    , h Run Help for current Cmd
    , ' Quote Line

    , q Push Line
    , g Get Line

    ^ v Edit Command Line in Vim
    ^ x, a Expand Alias
    ^ x, ^ v Vi Cmd Mode
    ^ x, ^ e Edit Command Line in Vim
    ^ x, ^ b Vi Macth Bracket

  • Aliases ( see in .zshrc )
    such as :
    alias d='docker'
    alias g='git'
    alias gco='git checkout'
    alias gd='git diff'
    alias gs='git status'

    alias la='ls -hA'
    alias ll='ls -hl'
    alias lla='ls -hlA'
    alias v='nvim'
    alias vh='v /etc/hosts'

    alias zl='cd ~/Documents'

  • Ref : oh-my-zsh & Official Docs.

Other Tools

2Do

I don’t want to list all its shortcuts, as there are so many…

⌘ s Sync

  • View
    ⌘ 0 Inbox
    ⌘ 1 All
    ⌘ 2 Today
    ⌘ 3 Starred
    ⌘ 4 Scheduled
    ⌘ 5 Done

    ⌘ ↑ Prev List
    ⌘ ↓ Next List
    ⌘ ⌥ ↑|↓ [ Collapse | Expand ] All Projects
    ⌘ ⇧ ↑|↓ [ Collapse | Expand ] All List Groups

  • Edit
    0 ~ 3 Priority : None | Low | Medium | High
    s Star
    ^ s Unstar

    d Due Date
    e Due Time
    k Schedule ( Start Date )

    t Start Today
    ^ t Due Today
    y Start Yesterday

    ⌘ / Dates
    ⌘ e Notes

    ⌘ ^ ⇧ 1 Convert to a Task
    ⌘ ^ ⇧ 2 Convert to a Project
    ⌘ ^ ⇧ 3 Convert to a Checklist

    ⌘ l Move to another list

    ⌘ . Mark as Completed
    ⌥ ⌘ . Mark as Not Completed

    ⌘ ; Recurrence ( aka Repeat )
    ⌘ ' Alerts

Chrome

  • Usual
    ⌘ l Edit Address Bar
    ⌘ d Bookmarks
    ⌘ ⌥ B Manage Bookmarks
    ⌘ y Full History
    ⌘ ⇧ J Downloads
    ⌘ ⇧ A Extensions

  • Development
    ⌘ ⌥ i Inspect Elements
    ⌘ ⌥ j JavaScript Console
    ⌘ ⌥ u Page Source Code

  • Extension
    ⌘ ⇧ E Evernote Web Clipper
    ⌘ ⇧ O Activate One Tab
    ⌘ ⇧ D Display One Tab
    ⌘ ⇧ C Send Current Tab to One Tab
    ⌘ ⇧ P Activate SwitchyOmega

cVim

It is a Vim-Emulator extension in Firefox.
My config file .cvimrc

  • Link
    f Open Link in Current Tab
    F Open Link in New Tab
    mf Open Links in New Tabs

  • Load
    r Refresh
    R Refresh ( including Cache )

  • Navigate
    z = H Backward
    b = L Forward

    gu Go up one path in the URL
    gU Go to the base URL

    [[ Prev Page
    ]] Next Page

  • Scroll

    • Vertical
      gg to Top
      G = ge to Btm

      j = Dn a Half Page
      k = ⇧ 凵 Up a Half Page

      d Dn a Whole Page
      q Up a Whole Page

    • Horizontal
      h Lf
      l Rg

      ! to Most Lf
      $ to Most Rg

  • Tab

    • Open Tab
      t New Tab
      a Select Tab
      c Copy URL of Current Tab to Clipboard
      S Duplicate Tab

      v Open URL in Clipboard in Current Tab
      V Open URL in Clipboard in New Tab

    • Move Tab
      W = < to Lf
      E = > to Rg

    • Close / Reopen Tab
      x Close Current Tab
      X Reopen Last Closed Tab

    • Switch Tab
      w = J to Prev
      e = K to Next
      gq to First
      gr to Last

      1 → 1st Tab
      2 → 2nd Tab
      3 → 3rd Tab

      9 → 9th Tab
      0 → 10th Tab
      s1 → 11th Tab

      s0 → 20th Tab

    • Others
      gm Mute / Unmute Tab
      gp Pin / Unpin Tab

  • Quick Start
    D chrome://download
    ge chrome://extensions
    gS cVim Settings
    ga Google
    gb Baidu
    gd Douban
    gj JD
    gt Taobao
    gw Weibo
    gz Zhihu

  • Input Box
    i Input in First Input Box
    I Input in Last Input Box

    ^ n Forward Word
    ^ p Backward Word

    ^ h Delete Char
    ^ k Delete to End of Line

  • Find
    / Find
    ? Find Backword

    n Next Match
    N Prev Match

  • Visual Mode
    Z Activaate Visual Mode
    v Start Selection
    y Copy Selection & Exit Visual Mode

    h ← Lf
    j ↓ Dn
    k ↑ Up
    l → Rg

    w Mv to Head of Next Word
    b Mv to Head of Prev Word

  • Others
    Cancel
    Q Help ( Manual )

Dictionary

⌘ ⇧ D Look Up in Dictionary
⌘ 0~9 Switch Dictionary

EuDict Free

⌥ 凵 Light Peek
⌘ ⇧ M Look up Word that Mouse Cursor Hovers
⌘ ⇧ L Look up Selection
⌘ ⇧ 2 Translate Selection

MindNode

  • File
    ⌥ ↩ New Mind Map
    ⌥ → Next Mind Map
    ⌥ ← Prev Mind Map

  • New
    Append New Sibling
    ⇧ ↩ Prepend New Sibling

    New Child
    ⇧ ⇥ New Parent

  • Edit
    ⌘ ↩ Edit Title ( Current )

    ⌘ ⇧ K Note Popover
    ⌘ ⇧ T Add / Rm Task ( Check Box )
    ⌘ ⇧ U Toggle Task

    ⌘ k Add Link
    ⌘ l Add Connection ( to Another Node )

  • Move
    ⌘ ↑ Move Above Sibling
    ⌘ ↓ Move Below Sibling
    ⌘ ⇧ D Detach Node

  • Fold
    ⌘ ⌥ ← Fold Node
    ⌘ ⌥ → Unfold Node
    ⌘ ⌥ ↑ Fold All Nodes
    ⌘ ⌥ ↓ Unfold All Nodes

  • Select
    ⌘ ⌥ a All Subnodes

NeteaseMusic

Play | Pause
⌘ → Next
⌘ ← Prev
⌘ ↑ Volume Up
⌘ ↓ Volume Down

⌘ l Dislike
⌘ r Show | Hide Lyrics

QQ

⌘ ^ a Screenshot
⌘ ^ r Screen Recording
Two functions above can be used without opening QQ.

⌘ ↑ Select Prev Chat
⌘ ↓ Select Next Chat
They can be used in WeChat as well.

⌘ 1 Switch to Messages
⌘ 2 Switch to Contacts
⌘ 3 Switch to Applications

0%