Skip to content

Commit 0fdc97c

Browse files
committed
Add new key mappings, add whitespace trimming for keys with multiple components
1 parent 7f4c7b0 commit 0fdc97c

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

CodingKeys/HotKey.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ - (NSArray *)mappedHotKeysForAppWithName:(NSString *)appName {
7676
NSMutableArray *mappedKeys = [NSMutableArray array];
7777

7878
for (NSString *mappingComponent in mappingComponents) {
79-
HotKey *hotKey = [[HotKey alloc] initWithKey:mappingComponent
79+
NSString *trimmedComponent = [mappingComponent stringByTrimmingCharactersInSet:
80+
[NSCharacterSet whitespaceCharacterSet]];
81+
82+
HotKey *hotKey = [[HotKey alloc] initWithKey:trimmedComponent
8083
mapping:nil];
8184
[mappedKeys addObject:hotKey];
8285
}

CodingKeys/data/keys.json

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"key": "⌘ D",
2727
"mapping":
2828
{
29-
"Xcode": "⌃ A|⇧ ↓|⌘ C|⌘ V|⌘ V",
29+
"Xcode": "⌃ A | ⇧ ↓ | ⌘ C | ⌘ V | ⌘ V",
3030
"Sublime Text": "⇧ ⌘ D",
3131
"Eclipse": "⌥ ⌘ ↓",
3232
"Android Studio": "⌘ D"
@@ -37,10 +37,43 @@
3737
"key": "⌘ ⌫",
3838
"mapping":
3939
{
40-
"Xcode": "⌃ A|⌃ K|⌃ K",
40+
"Xcode": "⌃ A | ⌃ K | ⌃ K",
4141
"Sublime Text": "⌃ ⇧ K",
4242
"Eclipse": "⌘ D",
4343
"Android Studio": "⌘ ⌫"
4444
}
45+
},
46+
{
47+
"command": "Format",
48+
"key": "⇧ ⌘ F",
49+
"mapping":
50+
{
51+
"Xcode": "⌃ I",
52+
"Sublime Text": "⌃ ⇧ R",
53+
"Eclipse": "⇧ ⌘ F",
54+
"Android Studio": "⌥ ⌘ L"
55+
}
56+
},
57+
{
58+
"command": "Rename",
59+
"key": "⌃ ⌘ R",
60+
"mapping":
61+
{
62+
"Xcode": "⌃ ⌥ R",
63+
"Sublime Text": "⌃ ⌘ G",
64+
"Eclipse": "⌥ ⌘ R",
65+
"Android Studio": "⇧ F6"
66+
}
67+
},
68+
{
69+
"command": "Find/Replace",
70+
"key": "⌥ ⌘ F",
71+
"mapping":
72+
{
73+
"Xcode": "⌥ ⌘ F",
74+
"Sublime Text": "⌥ ⌘ F",
75+
"Eclipse": "⌘ F",
76+
"Android Studio": "⌘ R"
77+
}
4578
}
4679
]

0 commit comments

Comments
 (0)