forked from sublime-emacs/sublemacspro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefault.sublime-keymap
260 lines (205 loc) · 13.1 KB
/
Default.sublime-keymap
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
[
{"keys": ["ctrl+g"], "command": "sbp_quit"},
//
// Motion commands: forward/backward word, identifiers (sexpression), beginning/end of file/window
//
{"keys": ["alt+f"], "command": "sbp_move_word", "args": {"direction": 1}},
{"keys": ["ctrl+alt+f"], "command": "sbp_move_sexpr", "args": {"direction": 1}},
{"keys": ["alt+b"], "command": "sbp_move_word", "args": {"direction": -1}},
{"keys": ["ctrl+alt+b"], "command": "sbp_move_sexpr", "args": {"direction": -1}},
{"keys": ["alt+c"], "command": "sbp_case_word", "args": {"direction": 1, "mode": "title"}},
{"keys": ["alt+u"], "command": "sbp_case_word", "args": {"direction": 1, "mode": "upper"}},
{"keys": ["alt+l"], "command": "sbp_case_word", "args": {"direction": 1, "mode": "lower"}},
{"keys": ["ctrl+x", "ctrl+u"], "command": "sbp_case_region", "args": {"mode": "upper"}},
{"keys": ["ctrl+x", "ctrl+l"], "command": "sbp_case_region", "args": {"mode": "lower"}},
{"keys": ["ctrl+alt+["], "command": "sbp_move_to_paragraph", "args": {"direction": 1} },
{"keys": ["ctrl+alt+]"], "command": "sbp_move_to_paragraph", "args": {"direction": -1} },
{"keys": ["ctrl+b"], "command": "move", "args": {"by": "characters", "forward": false} },
{"keys": ["ctrl+f"], "command": "move", "args": {"by": "characters", "forward": true} },
{"keys": ["ctrl+p"], "command": "move", "args": {"by": "lines", "forward": false} },
{"keys": ["ctrl+n"], "command": "move", "args": {"by": "lines", "forward": true} },
// commands that move and set the mark first
{"keys": ["alt+shift+."], "command": "sbp_move_to", "args": {"to": "eof"}},
{"keys": ["alt+shift+,"], "command": "sbp_move_to", "args": {"to": "bof"}},
{"keys": ["home"], "command": "sbp_move_to", "args": {"to": "bof"}},
{"keys": ["end"], "command": "sbp_move_to", "args": {"to": "eof"}},
{"keys": ["alt+."], "command": "sbp_move_to", "args": {"to": "eow"}},
{"keys": ["alt+,"], "command": "sbp_move_to", "args": {"to": "bow"}},
//
// misc
//
{"keys": ["ctrl+o"], "command": "sbp_open_line"},
{"keys": ["ctrl+l"], "command": "sbp_center_view"},
{"keys": ["ctrl+x", "g"], "command": "sbp_goto_line"},
{"keys": ["alt+g"], "command": "sbp_goto_line"},
// Goto open file
{"keys": ["ctrl+x", "ctrl+f"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{"keys": ["ctrl+x", "ctrl+b"], "command": "goto_open_file"},
// Goto Symbol
{"keys": ["ctrl+alt+g"], "command": "show_overlay", "args": {"overlay":"goto", "show_files" : false, "text": "@"}},
//
// Mark and point, kill region, kill line, yank and yank pop, deletion commands.
//
{"keys": ["ctrl+space"], "command": "sbp_set_mark"},
{"keys": ["ctrl+g"], "command": "sbp_cancel_mark", "context": [ {"key": "sbp_has_visible_mark", "operand": true}]},
{"keys": ["ctrl+x", "ctrl+x"], "command": "sbp_swap_point_and_mark"},
{"keys": ["ctrl+k"], "command": "sbp_move_then_delete", "args": {"move_cmd": "sbp_move_for_kill_line"}},
{"keys": ["ctrl+w"], "command": "sbp_kill_region"},
{"keys": ["ctrl+y"], "command": "sbp_yank"},
{"keys": ["super+v"], "command": "sbp_yank"},
{"keys": ["alt+w"], "command": "sbp_kill_region", "args": {"is_copy": true}},
{"keys": ["super+c"], "command": "sbp_kill_region", "args": {"is_copy": true}},
{"keys": ["alt+y"], "command": "sbp_yank", "args": {"pop": 1}},
{"keys": ["alt+shift+y"], "command": "sbp_yank", "args": {"pop": -1}},
{"keys": ["alt+d"], "command": "sbp_move_then_delete", "args": {"move_cmd": "sbp_move_word", "direction": 1}},
{"keys": ["alt+backspace"], "command": "sbp_move_then_delete", "args": {"move_cmd": "sbp_move_word", "direction": -1}},
{"keys": ["ctrl+alt+k"], "command": "sbp_move_then_delete", "args": {"move_cmd": "sbp_move_sexpr", "direction": 1}},
{"keys": ["alt+\\"], "command": "sbp_delete_white_space"},
{"keys": ["alt+z"], "command": "sbp_zap_to_char"},
// emacs-style numeric argument handling
{"keys": ["ctrl+u"], "command": "sbp_universal_argument", "args": {"value": "by_four"}},
{"keys": ["alt+-"], "command": "sbp_universal_argument", "args": {"value": "negative"}},
{"keys": ["alt+1"], "command": "sbp_universal_argument", "args": {"value": 1}},
{"keys": ["alt+2"], "command": "sbp_universal_argument", "args": {"value": 2}},
{"keys": ["alt+3"], "command": "sbp_universal_argument", "args": {"value": 3}},
{"keys": ["alt+4"], "command": "sbp_universal_argument", "args": {"value": 4}},
{"keys": ["alt+5"], "command": "sbp_universal_argument", "args": {"value": 5}},
{"keys": ["alt+6"], "command": "sbp_universal_argument", "args": {"value": 6}},
{"keys": ["alt+7"], "command": "sbp_universal_argument", "args": {"value": 7}},
{"keys": ["alt+8"], "command": "sbp_universal_argument", "args": {"value": 8}},
{"keys": ["alt+9"], "command": "sbp_universal_argument", "args": {"value": 9}},
{"keys": ["alt+0"], "command": "sbp_universal_argument", "args": {"value": 0}},
{"keys": ["alt+["], "command": "sbp_shift_region", "args": {"direction": -1}},
{"keys": ["alt+]"], "command": "sbp_shift_region", "args": {"direction": 1}},
//////////////////////////////
// Begin I-search //
//////////////////////////////
{"keys": ["ctrl+s"], "command": "sbp_inc_search", "args": {"forward": true, "regex": false}},
{"keys": ["ctrl+r"], "command": "sbp_inc_search", "args": {"forward": false, "regex": false}},
{"keys": ["ctrl+w"], "command": "sbp_inc_search", "args": {"cmd": "append_from_cursor"},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{"keys": ["super+d"], "command": "sbp_inc_search", "args": {"cmd": "next", "keep": true},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{"keys": ["alt+d"], "command": "sbp_inc_search", "args": {"cmd": "next", "keep": true},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{"keys": ["ctrl+s"], "command": "sbp_inc_search", "args": {"cmd": "next", "keep": false, "forward": true},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{"keys": ["ctrl+r"], "command": "sbp_inc_search", "args": {"cmd": "next", "keep": false, "forward": false},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{"keys": ["backspace"], "command": "sbp_inc_search", "args": {"cmd": "pop"},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{"keys": ["super+a"], "command": "sbp_inc_search", "args": {"cmd": "keep_all"},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{"keys": ["alt+a"], "command": "sbp_inc_search", "args": {"cmd": "keep_all"},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{"keys": ["escape"], "command": "sbp_inc_search", "args": {"cmd": "done"},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
{ "keys": ["ctrl+g"], "command": "sbp_inc_search", "args": {"cmd": "quit"},
"context": [ {"key": "i_search_active"}, {"key": "panel_has_focus"} ]
},
//////////////////
// End I-search //
//////////////////
{"keys": ["tab"], "command": "sbp_tab_cmd", "context": [
{"key": "panel_has_focus", "operand": false },
{"key": "auto_complete_visible", "operand": false },
{"key": "has_next_field", "operand": false },
{"key": "overlay_visible", "operand": false }]
},
/////////////////////////////
// Begin emacs window cmds //
/////////////////////////////
{"keys": ["ctrl+x", "2"], "command": "sbp_pane_cmd", "args": {"cmd": "split", "stype": "h"}},
{"keys": ["ctrl+x", "3"], "command": "sbp_pane_cmd", "args": {"cmd": "split", "stype": "v"}},
// Modifying the Pane Sies
{"keys": ["ctrl+shift+c+i"], "command": "sbp_pane_cmd", "args": {"cmd": "grow", "direction": "g"}},
{"keys": ["ctrl+shift+c+k"], "command": "sbp_pane_cmd", "args": {"cmd": "grow", "direction": "s"}},
{"keys": ["ctrl+shift+c+j"], "command": "sbp_pane_cmd", "args": {"cmd": "grow", "direction": "gh"}},
{"keys": ["ctrl+shift+c+l"], "command": "sbp_pane_cmd", "args": {"cmd": "grow", "direction": "sh"}},
{"keys": ["ctrl+x", "d"], "command": "sbp_pane_cmd", "args": {"cmd": "destroy", "pane": "self"}},
{"keys": ["ctrl+x", "0"], "command": "sbp_pane_cmd", "args": {"cmd": "destroy", "pane": "self"}},
{"keys": ["ctrl+x", "1"], "command": "sbp_pane_cmd", "args": {"cmd": "destroy", "pane": "others"}},
{"keys": ["ctrl+x", "n"], "command": "sbp_pane_cmd", "args": {"cmd": "move", "direction": "next"}},
{"keys": ["ctrl+x", "p"], "command": "sbp_pane_cmd", "args": {"cmd": "move", "direction": "prev"}},
{"keys": ["ctrl+x", "o"], "command": "sbp_pane_cmd", "args": {"cmd": "move", "direction": "next"}},
{"keys": ["super+shift+["], "command": "sbp_pane_cmd", "args": {"cmd": "switch_tab", "direction": "left"}},
{"keys": ["super+shift+]"], "command": "sbp_pane_cmd", "args": {"cmd": "switch_tab", "direction": "right"}},
{"keys": ["ctrl+x", "b"], "command": "next_view" },
{"keys": ["ctrl+x", "right"], "command": "next_view" },
{"keys": ["ctrl+x", "left"], "command": "prev_view" },
//////////////////////////////////////////////////////////////////////////////
// Other settings/bindings to complete the Emacs picture for me personally. //
//////////////////////////////////////////////////////////////////////////////
{"keys": ["ctrl+a"], "command": "move_to", "args": {"to": "hardbol", "extend": false }},
{"keys": ["ctrl+e"], "command": "move_to", "args": {"to": "hardeol", "extend": false }},
{"keys": ["alt+a"], "command": "move_to", "args": {"to": "bol", "extend": false }},
{"keys": ["alt+m"], "command": "move_to", "args": {"to": "bol", "extend": false }},
{"keys": ["ctrl+v"], "command": "move", "args": {"by": "pages", "forward": true }},
{"keys": ["alt+v"], "command": "move", "args": {"by": "pages", "forward": false }},
{"keys": ["alt+n"], "command": "next_result"},
{"keys": ["alt+p"], "command": "prev_result"},
{"keys": ["alt+;"], "command": "toggle_comment"},
{"keys": ["ctrl+x", "k"], "command": "close"},
{"keys": ["ctrl+d"], "command": "right_delete"},
{"keys": ["ctrl+\\"], "command": "undo"},
{"keys": ["ctrl+shift+-"], "command": "undo"},
{"keys": ["ctrl+x", "u"], "command": "undo" },
{"keys": ["ctrl+shift+\\"], "command": "redo"},
{"keys": ["ctrl+shift+/"], "command": "redo"},
{"keys": ["alt+h"], "command": "auto_complete"},
{"keys": ["ctrl+x", "ctrl+s"], "command": "save"},
{"keys": ["ctrl+x", "ctrl+m"], "command": "save_all"},
{"keys": ["ctrl+x", "s"], "command": "save_all"},
{"keys": ["ctrl+x", "ctrl+w"], "command": "prompt_save_as"},
{"keys": ["ctrl+x", "ctrl+c"], "command": "exit"},
{"keys": ["ctrl+x","h"], "command": "select_all"},
{"keys": ["ctrl+x", "("], "command": "toggle_record_macro" },
{"keys": ["ctrl+x", ")"], "command": "toggle_record_macro" },
{"keys": ["ctrl+x", "e"], "command": "run_macro" },
{"keys": ["alt+j"], "command": "wrap_lines", "args": {"width": 100}},
{"keys": ["shift+super+-"], "command": "decrease_font_size"},
{"keys": ["ctrl+c", ">"], "command": "indent" },
{"keys": ["ctrl+c", "<"], "command": "unindent" },
// Completion
{"keys": ["alt+/"], "command": "auto_complete" },
{"keys": ["alt+/"], "command": "replace_completion_with_auto_complete", "context":
[
{"key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
{"key": "auto_complete_visible", "operator": "equal", "operand": false },
{"key": "setting.tab_completion", "operator": "equal", "operand": true }
]
},
// Integration with default find and replace from sublime
{"keys": ["alt+r"], "command": "show_panel", "args": {"panel": "replace"} },
{"keys": ["super+r"], "command": "show_panel", "args": {"panel": "replace"} },
// {"keys": ["ctrl+s"], "command": "find_next", "context": [
// {"key": "panel_visible", "operator": "equal", "operand": true }
// ]
// },
// {"keys": ["ctrl+r"], "command": "find_prev", "context": [
// {"key": "panel_visible", "operator": "equal", "operand": true }
// ]
// },
// Rectangles
{"keys": ["ctrl+x", "r", "t"], "command": "sbp_rectangle_insert" },
{"keys": ["ctrl+x", "r", "d"], "command": "sbp_rectangle_delete" },
// Registers
{"keys": ["ctrl+x", "r", "s"], "command": "sbp_register_store" },
{"keys": ["ctrl+x", "r", "i"], "command": "sbp_register_insert" },
{"keys": ["ctrl+x", "r", " "], "command": "sbp_point_to_register" },
{"keys": ["ctrl+x", "r", "j"], "command": "sbp_point_from_register" }
// These override other commands
//{"keys": ["ctrl+z"], "command": "scroll_lines", "args": {"amount": -1 }},
//{"keys": ["alt+z"], "command": "scroll_lines", "args": {"amount": 1 }},
//{"keys": ["ctrl+x", "ctrl+f"], "command": "i_opener"},
//{"keys": ["alt+/"], "command": "toogle_comment"},
]