Skip to content

Commit 5e96f22

Browse files
committed
Restrict and disable key bindings by default
Resolves #147 Key bindings were globally enabled even in languages they don't make sense. This commit therefore... 1. adds "selector" contexts to restrict them to coffeescript 2. disables them by default as all commands are available via Command Palette. Users have to opt-in via "Preferences: CoffeeScript Key Bindings". Actually most of them rather seem to be "Build System Variants".
1 parent 460009d commit 5e96f22

File tree

3 files changed

+190
-28
lines changed

3 files changed

+190
-28
lines changed

Default (Linux).sublime-keymap

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,65 @@
11
[
2-
{"keys": ["alt+shift+s"], "command": "check_syntax"},
3-
{"keys": ["alt+shift+r"], "command": "run_script"},
4-
{"keys": ["alt+shift+t"], "command": "run_cake_task"},
5-
{"keys": ["alt+shift+c"], "command": "compile"},
6-
{"keys": ["alt+shift+d"], "command": "compile_and_display", "args": {"opt": "-p"}},
7-
{"keys": ["alt+shift+l"], "command": "compile_and_display", "args": {"opt": "-t"}},
8-
{"keys": ["alt+shift+n"], "command": "compile_and_display", "args": {"opt": "-n"}},
9-
{"keys": ["alt+shift+w"], "command": "toggle_watch"},
10-
{"keys": ["alt+shift+z"], "command": "toggle_output_panel"}
2+
// {
3+
// "keys": ["alt+shift+s"],
4+
// "command": "check_syntax",
5+
// "context": [
6+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
7+
// ]
8+
// },
9+
// {
10+
// "keys": ["alt+shift+r"],
11+
// "command": "run_script",
12+
// "context": [
13+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
14+
// ]
15+
// },
16+
// {
17+
// "keys": ["alt+shift+t"],
18+
// "command": "run_cake_task",
19+
// "context": [
20+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
21+
// ]
22+
// },
23+
// {
24+
// "keys": ["alt+shift+c"],
25+
// "command": "compile",
26+
// "context": [
27+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
28+
// ]
29+
// },
30+
// {
31+
// "keys": ["alt+shift+d"],
32+
// "command": "compile_and_display", "args": {"opt": "-p"},
33+
// "context": [
34+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
35+
// ]
36+
// },
37+
// {
38+
// "keys": ["alt+shift+l"],
39+
// "command": "compile_and_display", "args": {"opt": "-t"},
40+
// "context": [
41+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
42+
// ]
43+
// },
44+
// {
45+
// "keys": ["alt+shift+n"],
46+
// "command": "compile_and_display", "args": {"opt": "-n"},
47+
// "context": [
48+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
49+
// ]
50+
// },
51+
// {
52+
// "keys": ["alt+shift+w"],
53+
// "command": "toggle_watch",
54+
// "context": [
55+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
56+
// ]
57+
// },
58+
// {
59+
// "keys": ["alt+shift+z"],
60+
// "command": "toggle_output_panel",
61+
// "context": [
62+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
63+
// ]
64+
// }
1165
]

Default (OSX).sublime-keymap

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,65 @@
11
[
2-
{"keys": ["alt+shift+s"], "command": "check_syntax"},
3-
{"keys": ["alt+shift+r"], "command": "run_script"},
4-
{"keys": ["alt+shift+t"], "command": "run_cake_task"},
5-
{"keys": ["alt+shift+c"], "command": "compile"},
6-
{"keys": ["alt+shift+d"], "command": "compile_and_display", "args": {"opt": "-p"}},
7-
{"keys": ["alt+shift+x"], "command": "compile_and_display", "args": {"opt": "-t"}},
8-
{"keys": ["alt+shift+n"], "command": "compile_and_display", "args": {"opt": "-n"}},
9-
{"keys": ["alt+shift+w"], "command": "toggle_watch"},
10-
{"keys": ["alt+shift+z"], "command": "toggle_output_panel"}
11-
]
2+
// {
3+
// "keys": ["alt+shift+s"],
4+
// "command": "check_syntax",
5+
// "context": [
6+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
7+
// ]
8+
// },
9+
// {
10+
// "keys": ["alt+shift+r"],
11+
// "command": "run_script",
12+
// "context": [
13+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
14+
// ]
15+
// },
16+
// {
17+
// "keys": ["alt+shift+t"],
18+
// "command": "run_cake_task",
19+
// "context": [
20+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
21+
// ]
22+
// },
23+
// {
24+
// "keys": ["alt+shift+c"],
25+
// "command": "compile",
26+
// "context": [
27+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
28+
// ]
29+
// },
30+
// {
31+
// "keys": ["alt+shift+d"],
32+
// "command": "compile_and_display", "args": { "opt": "-p" },
33+
// "context": [
34+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
35+
// ]
36+
// },
37+
// {
38+
// "keys": ["alt+shift+x"],
39+
// "command": "compile_and_display", "args": { "opt": "-t" },
40+
// "context": [
41+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
42+
// ]
43+
// },
44+
// {
45+
// "keys": ["alt+shift+n"],
46+
// "command": "compile_and_display", "args": { "opt": "-n" },
47+
// "context": [
48+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
49+
// ]
50+
// },
51+
// {
52+
// "keys": ["alt+shift+w"],
53+
// "command": "toggle_watch",
54+
// "context": [
55+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
56+
// ]
57+
// },
58+
// {
59+
// "keys": ["alt+shift+z"],
60+
// "command": "toggle_output_panel",
61+
// "context": [
62+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
63+
// ]
64+
// }
65+
]

Default (Windows).sublime-keymap

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,65 @@
11
[
2-
{"keys": ["alt+shift+s"], "command": "check_syntax"},
3-
{"keys": ["alt+shift+r"], "command": "run_script"},
4-
{"keys": ["alt+shift+t"], "command": "run_cake_task"},
5-
{"keys": ["alt+shift+c"], "command": "compile"},
6-
{"keys": ["alt+shift+d"], "command": "compile_and_display", "args": {"opt": "-p"}},
7-
{"keys": ["alt+shift+l"], "command": "compile_and_display", "args": {"opt": "-t"}},
8-
{"keys": ["alt+shift+n"], "command": "compile_and_display", "args": {"opt": "-n"}},
9-
{"keys": ["alt+shift+w"], "command": "toggle_watch"},
10-
{"keys": ["alt+shift+z"], "command": "toggle_output_panel"}
2+
// {
3+
// "keys": ["alt+shift+s"],
4+
// "command": "check_syntax",
5+
// "context": [
6+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
7+
// ]
8+
// },
9+
// {
10+
// "keys": ["alt+shift+r"],
11+
// "command": "run_script",
12+
// "context": [
13+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
14+
// ]
15+
// },
16+
// {
17+
// "keys": ["alt+shift+t"],
18+
// "command": "run_cake_task",
19+
// "context": [
20+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
21+
// ]
22+
// },
23+
// {
24+
// "keys": ["alt+shift+c"],
25+
// "command": "compile",
26+
// "context": [
27+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
28+
// ]
29+
// },
30+
// {
31+
// "keys": ["alt+shift+d"],
32+
// "command": "compile_and_display", "args": {"opt": "-p"},
33+
// "context": [
34+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
35+
// ]
36+
// },
37+
// {
38+
// "keys": ["alt+shift+l"],
39+
// "command": "compile_and_display", "args": {"opt": "-t"},
40+
// "context": [
41+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
42+
// ]
43+
// },
44+
// {
45+
// "keys": ["alt+shift+n"],
46+
// "command": "compile_and_display", "args": {"opt": "-n"},
47+
// "context": [
48+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
49+
// ]
50+
// },
51+
// {
52+
// "keys": ["alt+shift+w"],
53+
// "command": "toggle_watch",
54+
// "context": [
55+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
56+
// ]
57+
// },
58+
// {
59+
// "keys": ["alt+shift+z"],
60+
// "command": "toggle_output_panel",
61+
// "context": [
62+
// { "key": "selector", "operand": "source.coffee, source.litcoffee" }
63+
// ]
64+
// }
1165
]

0 commit comments

Comments
 (0)