Mac 快捷键

天下武功,唯快不破。

Simple & Less

  • 没什么不好意思承认的,写这篇文章的初衷就是想炫耀自己的「与众不同」—— 彰显自己是一个酷爱快捷键的「键盘党」,一个有个性的少数派。然而这样做真的有意义吗?
  • 正确的做法:
    • 选用符合直觉的好设计 —— 它们容易上手、容易习惯,不容易被错误地使用。
      • 「开箱即用」,即用默认配置就能用得顺手,就是一个很高的标准。
    • 根据「二八法则」(帕累托法则),只做关键部分的改进,用更少的工具完成更多的事情。
      • 工具提供足够的设置选项,然后将工具配置得足够贴合个人的使用习惯。
        例如,同时使用多个 IDE 和代码编辑器的话,尽量将快捷键配置得一样,增强快捷键的通用性,减轻记忆快捷键的负担,减少误用;尽量都使用 Vim 插件,统一以 Vim 的方式操作,就可以进一步减轻记忆负担,增加操作效率。

Explanation

  • Here are the Mac shortcuts:
    • The default ones that I use most frequently
    • All my custom ones
  • I hide all the default shortcuts that are of little use.
  • Meanings of Font Format:
    • The item with the superscript custom  implies it might be custom by me.
  • The italic item is not frequently-used.
  • Related :
    Tools 利器
    Mac Efficiency 效率指北
  • Reference :
    Mac 键盘快捷键

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
  • ⌘ 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 , Seil.

System

  • Power

    Wake Up
    ⌘ ⌥  Sleep
    ^ ⇧  Display Sleep

    ^  Shut Down
    Then you can choose to Sleep or Restart in the prompt dialog box.

  • Accessory

    ⌘ 凵 Spotlight
    Lf ^ = ⌥ 凵 Switch Input Sources custom
    F1 Desktop custom

    ⌥ ⇧ F Search in All Files custom
    ⌥ ⇧ ? Show Help Menu custom

  • Dock & Menubar & Sidebar

    ^ F12 Do Not Disturb On/Off custom
    ⌘ ⌥ d Dock Hiding On/Off

Finder

  • File

    ⌘ ↓ Open

    ⌘ d Duplicate
    ⌘ e Eject Disk

  • Folder

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

    ⌘ ⇧ N New Folder
    ⌘ ↑ to Parent Dir

  • View

    Quick Look
    ⌘ i Get Info

    ⌘ 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

File & Edit

  • File

    ⌘ n New
    ⌘ o Open
    ⌘ s Save
    ⌘ p Print

    ⌘ ⇧ S Save as

  • Edit

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

    ⌥ ← Prev Word
    ⌥ → Next Word

    ⌘ a Select All

    ⌘ z Undo
    ⌘ ⇧ Z Redo

    ⌘ c Copy
    ⌘ ⌥ c Copy Path

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

    • After 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.

  • 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

Emacs Mode

A few people know that it’s supported in by default in macOS.
They don’t work, if you append any modifier key to them.

^ f =
^ b =
^ p =
^ n =

^ a = ⌘ ← Home
^ e = ⌘ → End

^ t Exchange the Charactors before & after the cursor
^ o Insert a Blank Line '\n' after the cursor

^ h = Del
^ d = Fn ⌫ Forward Del
^ k Del to the End of the Line

  • They are also enabled in iTerm2 :
    • Modified by .zshrc in Zsh and .vimrc in Vim
  • Moreover
    • Modified by Keyboard Maestro
      ^ w = ⌥ ⌫ Del Preceding Word custom
      ^ u = [ ^ a, ^ k ] Del the Whole Line custom
      These modifications can be supported in Karabiner too.
  • Ref : (Emacs) Keyboard Shortcuts for Editing Text Fields in OS X

Input Sources

  • Select

    Left ^ = ⌥ 凵 Switch Input Source
    ⌘ ^ 凵 Emoji & Symbols

  • Pinyin - Simplified (macOS default)

    [ Page Up
    ] Page Down
    Sort By
    0~9 Select

  • Baidu Input Now I use

    ^ t [ Simple | Traditional ] Chinese Characters

Activity Monitor

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

Crazy Remappings

  • What are they used to:

    • Remap the key codes.
    • Open or Switch to the specified app or URL.

Functional Keys = F1 ~ F12

⌥ ⇥ 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.

Layout

  • 0123 …

    凵 1 iTerm2
    凵 2 Sublime Text
    凵 3 Firefox
    凵 4 Chrome
    凵 5 2Do
    凵 6 System Settings → Keyboard
    凵 7 Keyboard Maestro
    凵 8 Karabiner
    凵 9 Seil

  • asdf …

    凵 o = \
    凵 p = | = ⇧ \
    凵 ;asdfghjkl = 0~9

  • Symbols

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

Layout ^

  • 1234 …

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

  • qwer …

    ⌥ q QQ
    ⌥ w WeChat
    ⌥ e Mail
    ⌥ r Preview
    ⌥ t Thunder

    ⌥ u Sublime Text
    ⌥ i iTunes
    ⌥ o OpenEmu
    ⌥ p Postman
    ⌥ \ 1Password ( Mini )

    ⌥ ⇧ Q QQMusic
    ⌥ ⇧ W Word
    ⌥ ⇧ P PowerPoint
    ⌥ ⇧ R VS Code
    ⌥ ⇧ E Evernote
    ⌥ ⇧ I Prompt the local IP address

    ^ ⌥ ⇧ E Excel

    ⌥ ] Show Bartender 2
    ⌥ ⇧ ] Show Bartender 2

  • asdf …

    ⌥ a PyCharm
    ⌥ s PhpStorm
    ⌥ d EuDic Free
    ⌥ f Finder
    ⌥ g Acrobat Reader ( PDF )

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

    ⌥ ⇧ A Activity Monitor
    ⌥ ⇧ S Safari
    ⌥ ⇧ D Dictionary
    ⌥ ⇧ F Search in All Files
    ⌥ ⇧ J Eject the disks
    ⌥ ⇧ K Calculator
    ⌥ ⇧ L System Settings → Launch Rocket

    ^ ⌥ ⇧ A App Store

  • zxcv …

    ⌥ x Xiami Music
    ⌥ c Charles
    ⌥ v ClipMenu ( History Menu )
    ⌥ b MindNode ( b for Brainstorm )

    ⌥ n NeteaseMusic
    ⌥ m Messages

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

    ^ ⌥ ⇧ M Sequel Pro ( MySQL )

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

Layout

  • 1234 …

    ⎋ 123456790-= = Functional Keys
    e.g. Functional keys control Brightness, Music, Volume, Keyboard Light & etc.

  • qwer …

    ⎋ w Weibo
    ⎋ e Sina ERP
    ⎋ r Sina Redmine

    ⎋ i IceHe.me
    ⎋ p PHP.net

  • asdf …

    ⎋ a Apple
    ⎋ g Google

    ⎋ h GitHub
    ⎋ l localhost:4000

  • zxcv …

    ⎋ z Sina GitLab
    ⎋ b Baidu

Keyboard Maestro

  • Search in Web

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

  • Abbrs

    • Date

      Type string |hm, it will be replaced by the time string hh:mm
      Type |ymd, replaced by yy/MM/dd
      |Ymd/YYYY/MM/dd
      |Ymd-YYYY-MM-dd
      ( I abbreviate the similar sentences below like this. )

    • Symbols

      |up
      |dn
      |lf
      |rg
      |esc
      |tab
      |cap
      |shf
      |opt | |alt
      |cmd
      |spa
      |del
      |ret | |ent
      |app

    • Others
      |[a-z]* → ID card number, my phone number & etc.

Karabiner

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

  • Quit

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

  • Profile

    ⌘ ⌥ ^ ⇧ 1 Switch to the default setting profile ( without all custom key-remapping )
    ⌘ ⌥ ^ ⇧ 2 Switch to the custom_mac setting profile
    ⌘ ⌥ ^ ⇧ 3 Switch to the custom_hhkb setting profile
    They’re used to toggle the custom setting profile for the guest who need to use my Mac temporarily.

  • Input Sources

    Rg = ⌘ 凵 Switch Input Source

Seil

  • Change Modifier-Key-Remapping

    Caps → ^ Lf Ctrl
    Rg Cmd → Esc

    ^ Ctrl → to Chinese Layout ( Baidu Input Method )
    Required:
    System PreferencesKeyboardsModifier Key : CapsLockControl, ControlNo Action
    App Seil : ^ Lf Ctrl → F19
    App Karabiner : F19F17
    App Keyboard Maestro : F17 → to Chinese Layout ( Ref )

    Lf & Rg Shf | Rg Cmd | Esc → English Input Method
    Required:
    App Karabiner : LR | R | will trigger F18 as well
    App Keyboard Maestro : F18 → to US English Layout

Contact

Mail

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

⌘ r Reply
⌘ ⇧ r Reply All

⌘ ⌥ f Mailbox Search

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

System Assistant

1Password

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

⌘ e Edit
⌘ s Save

ClipMenu

⌥ v History Menu
⌥ ⇧ V Main Menu

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.

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

  • Code

    ⌘ / Line Comment
    ⌘ ⌥ / Block Comment

    ⌥ ↑ Extend Selection
    ⌥ ↓ Shrink Selection

    ⌘ j Insert Live Template
    ^ 凵 Auto Complete
    ⌥ ↩ Show Intention Actions
    ⌘ ⇧ ↩ Complete Current Statement

    ^ ⌥ h Toggle Parameter Name
    ^ ⌥ g Select All Occurrences

  • 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

  • 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

    ⌥ 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
    ⌘ ↑ 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

    F2 Next Highlighted Error
    ⇧ F2 Prev Highlighted Error

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

  • VCS: History & Compare

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

    ^ ⌥ 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

  • Tools

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

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.

  • Tab

    H Prev Tab
    L Next Tab

  • Ctags Like

    ^ ] 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 )

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

  • Tripple h/j/k/l to Normal Mode

    hhh | jjj | kkk | lll =

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!

VS Code

  • File & Folder

    ^ r Open Recent
    ⌘ p Quick Open
    ^ ⇧ w Close Window

  • View

    ⌘ ⇧ E Explorer
    ⌘ ⇧ F Find in Files
    ⌘ ⇧ G Git
    ⌘ ⇧ D Debug
    ⌘ ⇧ A Extensions

    ⌘ b Toggle Side Bar
    ⌘ j Toggle Panel
    ^ ⌥ q Toggle Terminal

  • Editor Group

    ⌘ \ Split Editor
    ⌘ ⌥ 1 Toggle Editor Group Layout
    ⌘ k, 1~3 Switch to Editor Group 1~3

  • Vim

    H Prev Editor
    L Next Editor
    Y Copy to EOL (End of Line)

    zh Mv Editor Lf
    zl Mv Editor Rg

  • Selection

    ⌘ d Expand Selection to Word
    ⌘ ⇧ L Split into Lines

  • Find & Replace

    As same as Sublime Text

Sublime Text

  • Find & Replace

    ⌘ f Find
    ⌥ ↩ Find All

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

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

  • Selection

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

  • Bookmarks

    ⌘ F2 Toggle Bookmark
    F2 Next Bookmark
    ⇧ F2 Prev Bookmark
    ⌘ ⇧ F2 Clear All Bookmarks

  • 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

Charles

  • Proxy

    ⌘ r [ Start | Stop ] Recording

  • Session

    ⌘ ⌫ Clear

    ⌘ o Open
    ⌘ n New
    ⌘ s Save Request
    ⌘ ⇧ s Save As …

  • View

    ⌘ 1 Overview
    ⌘ 2 Request
    ⌘ 3 Response

    ⌘ 0 Sequence
    ⌘ 9 Structure

  • Tools

    ⌘ ⇧ R Repeat

    ⌘ ⇧ D DNS Spoofing Settings custom
    ⌘ ⌥ m Map Remote

    ⌘ m Compose ( Edit )
    ⌘ ⇧ M Compose New

Script Editor

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

CLI

tmux

More details in Official Docs.

^ 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, \ 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.

  • 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

  • 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
  • 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 字符串替换及小技巧
  • Command

    . Repeat Command

  • Cp

    ⇧ Y Copy from the cursor to the end of line

  • 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

  • Save & Quit

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

  • Tripple h/j/k/l to Normal Mode

    hhh | jjj | kkk | lll =

  • I used to use the Vim Distribution spf13-vim.
  • Vim Cheat Sheet - Image
  • More details in Official Docs.
  • TODO: I will write another article for Vim and will move the content above about Vim to it._

Zsh

^ v Edit Command Line in Vim

  • 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 = Prev | Up
    ^ n = Next | Dn

    ^ 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

    , f Forward Word
    , b Backward Word

    , h Run Help for current Cmd
    , ' Quote Line

    , q Push Line
    , g Get Line

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

  • Aliases

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

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

Evernote

  • Note

    ⌘ ^ s Sync

  • Edit

    ⌘ ⇧ H Insert Horizontal Rule
    ⌘ ⇧ T Insert To-Do

    • After Selection, then input:

      Increase Indent
      ⇧ ⇥ Decrease Indent

      ⌘ ^ c Code Block
      ⌘ ^ k Strikethrough

      ⌘ k Add Link
      ⌘ ⇧ K Rm Link
      ⌘ ⇧ F Simplify ( Rm ) Formatting
      ⌘ ⇧ V Copy and Match Style

      ⌘ ⇧ O Toggle Numbered List ( Ordered )
      ⌘ ⇧ U Toggle Bulleted List ( Unordered )

  • Input

    *, → Bulleted List
    1., → Numbered List

    In a new line, input - 3 times, - insert Horizontal Rule
    In a new line, input ` 3 times, - insert Code Quote

Web Clipper

  • Activate

    ^ ` Open Clip Mode
    Exit

  • After activation

    ⇧ A All Main Text
    ⇧ C Main Text without Advertisement
    ⇧ F Full Web Page
    ⇧ B Clip as a Bookmark
    ⇧ M Capture

    Extend Selection
    Shrink Selection
    Save

Firefox

  • Common

    ⌘ l Edit Address Bar
    ⌘ j Downloads
    ⌘ b Bookmarks ( Badly Use )
    ⌘ ⇧ B Manage Bookmarks
    ⌘ ⇧ H Toggle History
    ⌘ ⇧ A Extensions

  • Development

    ⌘ ⌥ i Inspect Elements
    ⌘ u Page Source Code

VimFX

It is a Vim-Emulator extension in Firefox.

  • Input

    c Input in Address Bar
    i Input in First Input Box

  • Link

    f Open Link in Current Tab
    F Open Link in New Tab
    ^ f Open Links in New Tabs

    C Copy URL of Current Tab to Clipboard

    • Hint ( After f | F and the link )

      Delete the Last Hint Character
      | ⇧ 凵 Switch Hint Layout

  • Tab

    • Open Tab

      t New at the Last of Tabs
      T New at the Rg of Cur Tab
      S Duplicate

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

    • Switch Tab

      w to Prev
      e to Next

      0 = ! = 1 = ) to First
      4 = $ to Last

      ⇧ 6 to First Unpined Top

    • Move Tab

      W to Lf
      E to Rg

    • Close Tab

      x Close Current Tab

    • Regret Op

      X Reopen Last Closed Tab

      ^ x List of Last Closed Tabs of Tabs
      ^ p Pin / Unpin

  • 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

    • Specified Pos

      m, a~z Mark the Page Pos represented by ‘a~z’
      `, a~z = ', z~z to the Mark represented by ‘a~z’

  • Navigate

    z Backward
    b Forward

    [ Prev Page
    ] Next Page

    gH Cur Tab Visit History Menu

  • Load

    r Refresh
    R Refresh ( including Cache )

  • Find

    / Find
    a/ Find All

    n Next Match
    N Prev Match

  • Visual

    ^ c Copy Element Text

    ^ i Enter Visual Mode & Put Cursor at Head of Element
    ^ s Enter Visual Mode & Select Element Text
    ^ n Exit Visual Mode

    ^ v Select Focus Point

    • Visual Mode

      v Start / Cancel Selection
      o Switch Cursor between Head and End of Selection
      y Copy Selection & Exit Visual Mode

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

      ^ a Mv to Head of the line
      ^ e Mv to End of the Line

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

  • Others

    Q Click Elements of Browser

    I Enter Ignore Mode ( Ignore All VimFX Shortcuts )
    ^ n Exit Ignore Mode ( Back to Normal Mode )

    gB Edit VimFX Blacklist

    ? Help Tips
    | ^ [ Cancel

NeteaseMusic

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

ShadowsocksX-NG

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

0%