Skip to content

Commit 76e14af

Browse files
committed
Added support for MagicPython and Python Improved syntaxes
Fixes #32
1 parent 9a9e6ad commit 76e14af

1 file changed

Lines changed: 115 additions & 93 deletions

File tree

Default.sublime-keymap

Lines changed: 115 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,146 @@
11
[
2-
// Sublime v3000 Docstrings
2+
// Python v3000
33
{
4-
"keys": [
5-
"enter"
6-
],
7-
"command": "docblockr_python",
8-
"context": [
9-
{ "key": "selector", "operator": "equal", "operand": "string.quoted.double.block", "match_all": false },
10-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
11-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
12-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
13-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
4+
"keys": [ "enter" ], "command": "docblockr_python", "context": [
5+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.double.block", "match_all": false },
6+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
7+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
8+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
9+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
1410
]
1511
},
1612
{
17-
"keys": [
18-
"keypad_enter"
19-
],
20-
"command": "docblockr_python",
21-
"context": [
22-
{ "key": "selector", "operator": "equal", "operand": "string.quoted.double.block", "match_all": false },
23-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
24-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
25-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
26-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
13+
"keys": [ "keypad_enter" ], "command": "docblockr_python", "context": [
14+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.double.block", "match_all": false },
15+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
16+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
17+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
18+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
2719
]
2820
},
2921
{
30-
"keys": [
31-
"tab"
32-
],
33-
"command": "docblockr_python",
34-
"context": [
35-
{ "key": "selector", "operator": "equal", "operand": "string.quoted.double.block", "match_all": false },
36-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
37-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
38-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
39-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
22+
"keys": [ "tab" ], "command": "docblockr_python", "context": [
23+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.double.block", "match_all": false },
24+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
25+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
26+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
27+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
4028
]
4129
},
4230

43-
// Sublime v3114 function docstrings
31+
// Sublime v3114
4432
{
45-
"keys": [
46-
"enter"
47-
],
48-
"command": "docblockr_python",
49-
"context": [
50-
{ "key": "selector", "operator": "equal", "operand": "comment.block.python", "match_all": false },
51-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
52-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
53-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
54-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
33+
"keys": [ "enter" ], "command": "docblockr_python", "context": [
34+
{ "key": "selector", "operator": "equal", "operand": "comment.block.python", "match_all": false },
35+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
36+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
37+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
38+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
5539
]
5640
},
5741
{
58-
"keys": [
59-
"keypad_enter"
60-
],
61-
"command": "docblockr_python",
62-
"context": [
63-
{ "key": "selector", "operator": "equal", "operand": "comment.block.python", "match_all": false },
64-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
65-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
66-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
67-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
42+
"keys": [ "keypad_enter" ], "command": "docblockr_python", "context": [
43+
{ "key": "selector", "operator": "equal", "operand": "comment.block.python", "match_all": false },
44+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
45+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
46+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
47+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
6848
]
6949
},
7050
{
71-
"keys": [
72-
"tab"
73-
],
74-
"command": "docblockr_python",
75-
"context": [
76-
{ "key": "selector", "operator": "equal", "operand": "comment.block.python", "match_all": false },
77-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
78-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
79-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
80-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
51+
"keys": [ "tab" ], "command": "docblockr_python", "context": [
52+
{ "key": "selector", "operator": "equal", "operand": "comment.block.python", "match_all": false },
53+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
54+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
55+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
56+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
8157
]
8258
},
8359

84-
// Sublime v3126 function docstrings
60+
// Sublime v3126
8561
{
86-
"keys": [
87-
"enter"
88-
],
89-
"command": "docblockr_python",
90-
"context": [
91-
{ "key": "selector", "operator": "equal", "operand": "comment.block.documentation.python", "match_all": false },
92-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
93-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
94-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
95-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
62+
"keys": [ "enter" ], "command": "docblockr_python", "context": [
63+
{ "key": "selector", "operator": "equal", "operand": "comment.block.documentation.python", "match_all": false },
64+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
65+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
66+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
67+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
9668
]
9769
},
9870
{
99-
"keys": [
100-
"keypad_enter"
101-
],
102-
"command": "docblockr_python",
103-
"context": [
104-
{ "key": "selector", "operator": "equal", "operand": "comment.block.documentation.python", "match_all": false },
105-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
106-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
107-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
108-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
71+
"keys": [ "keypad_enter" ], "command": "docblockr_python", "context": [
72+
{ "key": "selector", "operator": "equal", "operand": "comment.block.documentation.python", "match_all": false },
73+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
74+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
75+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
76+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
10977
]
11078
},
11179
{
112-
"keys": [
113-
"tab"
114-
],
115-
"command": "docblockr_python",
116-
"context": [
117-
{ "key": "selector", "operator": "equal", "operand": "comment.block.documentation.python", "match_all": false },
118-
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
119-
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
120-
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
121-
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
80+
"keys": [ "tab" ], "command": "docblockr_python", "context": [
81+
{ "key": "selector", "operator": "equal", "operand": "comment.block.documentation.python", "match_all": false },
82+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
83+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
84+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
85+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
86+
]
87+
},
88+
89+
// MagicPython
90+
{
91+
"keys": [ "enter" ], "command": "docblockr_python", "context": [
92+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.docstring.multi.python", "match_all": false },
93+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
94+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
95+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
96+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
97+
]
98+
},
99+
{
100+
"keys": [ "keypad_enter" ], "command": "docblockr_python", "context": [
101+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.docstring.multi.python", "match_all": false },
102+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
103+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
104+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
105+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
106+
]
107+
},
108+
{
109+
"keys": [ "tab" ], "command": "docblockr_python", "context": [
110+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.docstring.multi.python", "match_all": false },
111+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
112+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
113+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
114+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
115+
]
116+
},
117+
118+
// Python Improved
119+
{
120+
"keys": [ "enter" ], "command": "docblockr_python", "context": [
121+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.single.block.python", "match_all": false },
122+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
123+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
124+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
125+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
126+
]
127+
},
128+
{
129+
"keys": [ "keypad_enter" ], "command": "docblockr_python", "context": [
130+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.single.block.python", "match_all": false },
131+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
132+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
133+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
134+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
135+
]
136+
},
137+
{
138+
"keys": [ "tab" ], "command": "docblockr_python", "context": [
139+
{ "key": "selector", "operator": "equal", "operand": "string.quoted.single.block.python", "match_all": false },
140+
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
141+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
142+
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
143+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\"\"\"|''')\\s*$", "match_all": true }
122144
]
123145
}
124146
]

0 commit comments

Comments
 (0)