-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefaultKeyBinding.dict
31 lines (27 loc) · 1.05 KB
/
DefaultKeyBinding.dict
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
/* Setting custom keybindings on macOS. See documentation [1]. Inspired by [2].
* For reference: ^ is control, ~ is option.
*
* TODO: these bindings aren't being respected by some apps, e.g. Apple Notes, so
* consider using another solution like [3]
*
* [1] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html
* [2] https://www.reddit.com/r/MacOS/comments/xz4c8l/comment/irkarsk/
* [3] https://karabiner-elements.pqrs.org/
*/
/*
* Key Bindings for Emacs-like shortcuts on macOS
*/
/* Move forward (C-f) & backward (C-b) by a character.
* AFAICT this should be default macOS behavior, but adding here for explicitness.
*/
"^f" = "moveForward:";
"^b" = "moveBackward:";
/* Move forward (M-f) & backward (M-b) by a word */
"~f" = "moveWordForward:";
"~b" = "moveWordBackward:";
/* Copy (M-w), Cut (C-w), and Paste (C-y) */
"~w" = "copy:";
"^w" = "cut:";
"^y" = "paste:";
}