-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeybindings.json
310 lines (257 loc) · 33.4 KB
/
keybindings.json
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
[
{ "key": "shift+alt+g", "command": "editor.action.previousMatchFindAction", "when": "editorFocus" },
{ "key": "shift+cmd+g", "command": "-editor.action.previousMatchFindAction", "when": "editorFocus" },
{ "key": "shift+alt+g", "command": "workbench.action.terminal.findPrevious", "when": "terminalFindFocused && terminalHasBeenCreated || terminalFindFocused && terminalProcessSupported || terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" },
{ "key": "shift+cmd+g", "command": "-workbench.action.terminal.findPrevious", "when": "terminalFindFocused && terminalHasBeenCreated || terminalFindFocused && terminalProcessSupported || terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" },
{ "key": "shift+alt+g", "command": "workbench.action.terminal.openDetectedLink", "when": "accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal'" },
{ "key": "shift+cmd+g", "command": "-workbench.action.terminal.openDetectedLink", "when": "accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal'" },
{ "key": "shift+cmd+g", "command": "workbench.view.scm", "when": "workbench.scm.active" },
{ "key": "ctrl+shift+g", "command": "-workbench.view.scm", "when": "workbench.scm.active" },
{ "key": "shift+cmd+g", "command": "workbench.view.scm", "when": "workbench.scm.active && !gitlens:djkkjisabled && config.gitlens.keymap == 'chorded'" },
{ "key": "ctrl+shift+g", "command": "-workbench.view.scm", "when": "workbench.scm.active && !gitlens:disabled && config.gitlens.keymap == 'chorded'" },
// Improve list navigation (e.g. file explorer)
{ "key": "j", "command": "list.focusDown", "when": "listFocus && !inputFocus" },
{ "key": "k", "command": "list.focusUp", "when": "listFocus && !inputFocus" },
{ "key": "ctrl+u", "command": "list.focusPageUp", "when": "listFocus && !inputFocus" },
{ "key": "ctrl+d", "command": "list.focusPageDown", "when": "listFocus && !inputFocus" },
{ "key": "l", "command": "list.expand", "when": "listFocus && treeElementCanExpand && !inputFocus || listFocus && treeElementHasChild && !inputFocus" },
{ "key": "right", "command": "list.expand", "when": "listFocus && treeElementCanExpand && !inputFocus || listFocus && treeElementHasChild && !inputFocus" },
{ "key": "h", "command": "list.collapse", "when": "listFocus && treeElementCanCollapse && !inputFocus || listFocus && treeElementHasParent && !inputFocus" },
{ "key": "left", "command": "list.collapse", "when": "listFocus && treeElementCanCollapse && !inputFocus || listFocus && treeElementHasParent && !inputFocus" },
{ "key": "ctrl+h", "command": "list.collapseAll", "when": "listFocus && !inputFocus" },
{ "key": "ctrl+left", "command": "list.collapseAll", "when": "listFocus && !inputFocus" },
// Improved explorer keybindings
{ "key": "ctrl+n", "command": "explorer.newFile", "when": "explorerViewletFocus" },
{ "key": "ctrl+shift+n", "command": "explorer.newFolder", "when": "explorerViewletFocus" },
{ "key": "shift+cmd+c", "command": "workbench.files.action.collapseExplorerFolders" },
// Open file and focus
{ "key": "shift+space", "command": "explorer.openAndPassFocus", "when": "explorerViewletFocus" },
// Extension keybindings
{
"key": "shift+cmd+\\",
"command": "runCommands",
"args": {
"commands": [
"magit.status",
{
"command": "dance.modes.set",
"args": { "mode": "magit" }
}
]
}
},
// -------------------------------------------------------------
// Helix keybindings for dance
// https://github.com/71/dance/issues/299#issuecomment-1655509531
//
// Normal mode
//
{ "key": "h", "command": "dance.select.left.jump", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "j", "command": "dance.select.down.jump", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "k", "command": "dance.select.up.jump", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "l", "command": "dance.run", "args": { "commands": [".selections.reduce", ".select.right.jump"] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "t", "command": "dance.seek", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "f", "command": "dance.seek.included", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+t", "command": "dance.seek.backward", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+f", "command": "dance.seek.included.backward", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "r", "command": "dance.edit.replaceCharacters", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{
"key": "shift+r",
"command": "dance.run",
"args": {
"commands": [
[".selections.saveText", { "register": "tmp" }],
[".edit.insert", { "register": "*" }],
[".updateRegister", { "copyFrom": "tmp" }]
]
},
"when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'"
},
{ "key": "alt+.", "command": "dance.history.repeat.seek", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+`", "command": "dance.edit.case.swap", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "`", "command": "dance.edit.case.toLower", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+`", "command": "dance.edit.case.toUpper", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "home", "command": "dance.select.lineStart", "args": { "shift": "jump" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "end", "command": "dance.select.lineEnd", "args": { "shift": "jump" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "w", "command": "dance.seek.word", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "b", "command": "dance.seek.word.backward", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "e", "command": "dance.seek.wordEnd", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+w", "command": "dance.seek.word", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+b", "command": "dance.seek.word.backward", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+e", "command": "dance.seek.wordEnd", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "v", "command": "dance.modes.set", "args": { "mode": "select" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+g", "command": "dance.select.lineStart", "args": { "shift": "jump" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "g", "command": "dance.openMenu", "args": { "menu": "goto-hx", "pass": [{ "shift": "jump" }] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+;", "command": "workbench.action.showCommands", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "i", "command": "dance.modes.insert.before", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "a", "command": "dance.run", "args": { "commands": [".modes.insert.after", ".select.right.jump"] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "o", "command": "dance.run", "args": { "commands": [".selections.reduce", ".edit.newLine.below.insert"] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+i", "command": "dance.modes.insert.lineStart", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+a", "command": "dance.run", "args": { "commands": [[".select.lineEnd", { "shift": "jump" }], ".select.right.jump", ".modes.insert.before"] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+o", "command": "dance.edit.newLine.above.insert", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "d", "command": "dance.edit.yank-delete", "args": { "register": "*" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+d", "command": "dance.edit.delete", "args": { "register": "*" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "c", "command": "dance.edit.yank-delete-insert", "args": { "register": "*" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+c", "command": "dance.edit.delete-insert", "args": { "register": "*" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+c", "command": "dance.selections.copy", "args": { "direction": 1 }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+c", "command": "dance.selections.copy", "args": { "direction": -1 }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "s", "command": "dance.selections.select", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+s", "command": "dance.selections.splitLines", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+-", "command": "dance.selections.merge", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+s", "command": "dance.selections.split", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": ";", "command": "dance.selections.reduce", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+;", "command": "dance.selections.changeDirection", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+o", "command": "editor.action.smartSelect.expand", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+i", "command": "editor.action.smartSelect.shrink", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
// { "key": "alt+p", "command": "???", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
// { "key": "alt+n", "command": "???", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+5", "command": "dance.select.buffer", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "x", "command": "dance.select.line.below.extend", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+x", "command": "dance.selections.expandToLines", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+x", "command": "dance.selections.trimLines", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "m", "command": "dance.openMenu", "args": { "menu": "match-hx" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "[", "command": "dance.openMenu", "args": { "menu": "left-bracket-hx", "pass": [{ "shift": "jump" }] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "]", "command": "dance.openMenu", "args": { "menu": "right-bracket-hx", "pass": [{ "shift": "jump" }] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "/", "command": "dance.search", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+/", "command": "dance.search.backward", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "n", "command": "dance.search.next", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+n", "command": "dance.search.previous", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+8", "command": "dance.search.selection.smart", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+8", "command": "dance.search.selection", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "u", "command": "dance.history.undo", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+u", "command": "dance.history.redo", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+u", "command": "dance.history.undo.selections", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+u", "command": "dance.history.redo.selections", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "y", "command": "dance.selections.saveText", "args": { "register": "*" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "p", "command": "dance.edit.paste.after", "args": { "register": "*" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+p", "command": "dance.edit.paste.before", "args": { "register": "*" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "q", "command": "dance.history.recording.play", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+q", "command": "dance.history.recording.start", "when": "editorTextFocus && dance.mode == 'normal' && !dance.isRecording || editorTextFocus && dance.mode == 'select' && !dance.isRecording" },
{ "key": "shift+q", "command": "dance.history.recording.stop", "when": "editorTextFocus && dance.mode == 'normal' && dance.isRecording || editorTextFocus && dance.mode == 'select' && dance.isRecording" },
{ "key": "shift+,", "command": "dance.edit.deindent.withIncomplete", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+.", "command": "dance.edit.indent", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "=", "command": "editor.action.formatSelection", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+j", "command": "dance.edit.join", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+j", "command": "dance.edit.join.select", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+k", "command": "dance.selections.filter.regexp", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+k", "command": "dance.selections.filter.regexp.inverse", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": ",", "command": "dance.selections.clear.secondary", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+,", "command": "dance.selections.clear.main", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+7", "command": "dance.edit.align", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+-", "command": "dance.selections.trimWhitespace", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+9", "command": "dance.selections.rotate.selections", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+0", "command": "dance.selections.rotate.selections.reverse", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+9", "command": "dance.selections.rotate.both", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+0", "command": "dance.selections.rotate.both.reverse", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+;", "command": "dance.selections.faceForward", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": ".", "command": "dance.history.repeat.edit", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "escape", "command": "dance.modes.set.normal", "when": "editorTextFocus && dance.mode != 'normal'" },
{ "key": "ctrl+b", "command": "dance.select.vertically", "args": { "direction": -1, "by": "page", "shift": "jump" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+f", "command": "dance.select.vertically", "args": { "direction": 1, "by": "page", "shift": "jump" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+u", "command": "dance.select.vertically", "args": { "direction": -1, "by": "halfPage", "shift": "jump" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+d", "command": "dance.select.vertically", "args": { "direction": 1, "by": "halfPage", "shift": "jump" }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+w", "command": "dance.openMenu", "args": { "menu": "window-hx", "pass": [{ "shift": "jump" }] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+c", "command": "editor.action.commentLine", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+i", "command": "workbench.action.navigateForward", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "tab", "command": "workbench.action.navigateForward", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+o", "command": "workbench.action.navigateBack", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+s", "command": "dance.selections.save", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "space", "command": "dance.openMenu", "args": { "menu": "leader-hx", "pass": [{ "shift": "jump" }] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "z", "command": "dance.openMenu", "args": { "menu": "view-hx", "pass": [{ "shift": "jump" }] }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+z", "command": "dance.openMenu", "args": { "menu": "view-hx", "pass": [{ "shift": "jump" }], "locked": true }, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+'", "command": "dance.selectRegister", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+\\", "command": "dance.selections.pipe", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+1", "command": "dance.selections.pipe.prepend", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "alt+shift+1", "command": "dance.selections.pipe.append", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+4", "command": "dance.selections.filter", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+z", "command": "workbench.action.terminal.toggleTerminal" },
{ "key": "ctrl+a", "command": "editor.emmet.action.incrementNumberByOne", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+x", "command": "editor.emmet.action.decrementNumberByOne", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "\\", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "'", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+y", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+[", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+]", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+d", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+h", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+l", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+v", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+m", "command": "dance.ignore", "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
//
// Select
//
{ "key": "h", "command": "dance.select.left.extend", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "j", "command": "dance.select.down.extend", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "k", "command": "dance.select.up.extend", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "l", "command": "dance.select.right.extend", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "w", "command": "dance.run", "args": { "code": ["const oldAnchor = Selections.mapByIndex((_i, sel) => sel.anchor);", "await vscode.commands.executeCommand('dance.seek.word.extend');", "Selections.updateWithFallbackByIndex((i, sel) => sel.isReversed && oldAnchor[i].character >= sel.anchor.character ? new vscode.Selection(Positions.at(sel.anchor.line, sel.anchor.character+1), sel.active) : sel);"] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "b", "command": "dance.run", "args": { "code": ["const oldAnchor = Selections.mapByIndex((_i, sel) => sel.anchor);", "await vscode.commands.executeCommand('dance.seek.word.extend.backward');", "Selections.updateWithFallbackByIndex((i, sel) => !sel.isReversed && oldAnchor[i].character < sel.anchor.character ? new vscode.Selection(Positions.at(sel.anchor.line, sel.anchor.character-1), sel.active) : sel);"] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "e", "command": "dance.run", "args": { "code": ["const oldAnchor = Selections.mapByIndex((_i, sel) => sel.anchor);", "await vscode.commands.executeCommand('dance.seek.wordEnd.extend');", "Selections.updateWithFallbackByIndex((i, sel) => sel.isReversed && oldAnchor[i].character >= sel.anchor.character ? new vscode.Selection(Positions.at(sel.anchor.line, sel.anchor.character+1), sel.active) : sel);"] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+w", "command": "dance.seek.word", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+b", "command": "dance.seek.word.backward", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+e", "command": "dance.seek.wordEnd", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "/", "command": "dance.search.extend", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+/", "command": "dance.search.backward.extend", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "n", "command": "dance.search.next.add", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+n", "command": "dance.search.previous.add", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "t", "command": "dance.seek.extend", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "f", "command": "dance.seek.included.extend", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+t", "command": "dance.seek.backward", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+f", "command": "dance.seek.included.backward", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "home", "command": "dance.select.lineStart", "args": [{ "shift": "extend" }], "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "end", "command": "dance.select.lineEnd", "args": [{ "shift": "extend" }], "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+b", "command": "dance.select.vertically", "args": { "shift": "extend", "direction": -1, "by": "page" }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+f", "command": "dance.select.vertically", "args": { "shift": "extend", "direction": 1, "by": "page" }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+u", "command": "dance.select.vertically", "args": { "shift": "extend", "direction": -1, "by": "halfPage" }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+d", "command": "dance.select.vertically", "args": { "shift": "extend", "direction": 1, "by": "halfPage" }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "v", "command": "dance.modes.set.normal", "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "g", "command": "dance.openMenu", "args": { "menu": "goto-hx", "pass": [{ "shift": "extend" }] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "m", "command": "dance.openMenu", "args": { "menu": "match-hx" }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "z", "command": "dance.openMenu", "args": { "menu": "view-hx", "pass": [{ "shift": "extend" }] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+z", "command": "dance.openMenu", "args": { "menu": "view-hx", "pass": [{ "shift": "extend" }], "locked": true }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "ctrl+w", "command": "dance.openMenu", "args": { "menu": "window-hx", "pass": [{ "shift": "extend" }] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "[", "command": "dance.openMenu", "args": { "menu": "left-bracket-hx", "pass": [{ "shift": "extend" }] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "]", "command": "dance.openMenu", "args": { "menu": "right-bracket-hx", "pass": [{ "shift": "extend" }] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "space", "command": "dance.openMenu", "args": { "menu": "leader-hx", "pass": [{ "shift": "extend" }] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "r", "command": "dance.run", "args": { "commands": [".edit.replaceCharacters", ".modes.set.normal"] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "shift+r", "command": "dance.run", "args": { "commands": [[".selections.saveText", { "register": "tmp" }], [".edit.insert", { "register": "*" }], [".updateRegister", { "copyFrom": "tmp" }], ".modes.set.normal"] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "y", "command": "dance.run", "args": { "commands": [[".selections.saveText", { "register": "*" }], ".modes.set.normal"] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "d", "command": "dance.run", "args": { "commands": [[".edit.yank-delete", { "register": "*" }], ".modes.set.normal"] }, "when": "editorTextFocus && dance.mode == 'select'" },
{ "key": "x", "command": "dance.run", "args": { "commands": [[".selections.changeDirection", { "direction": 1 }], ".select.line.below.extend", ".selections.expandToLines"] }, "when": "editorTextFocus && dance.mode == 'select'" },
//
// Insert mode
//
{ "key": "tab", "command": "selectNextQuickFix", "when": "editorFocus && quickFixWidgetVisible" },
{ "key": "tab", "command": "selectNextSuggestion", "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible" },
{ "key": "shift+tab", "command": "selectPrevQuickFix", "when": "editorFocus && quickFixWidgetVisible" },
{ "key": "shift+tab", "command": "selectPrevSuggestion", "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible" },
{ "key": "ctrl+x", "command": "editor.action.triggerSuggest", "when": "!suggestWidgetVisible && editorHasCompletionItemProvider && textInputFocus && !editorReadonly" },
{ "key": "ctrl+r", "command": "dance.edit.selectRegister-insert", "when": "editorTextFocus && dance.mode == 'insert'" },
// { "key": "ctrl+s", "command": "???", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+w", "command": "deleteWordLeft", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "alt+d", "command": "deleteWordRight", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+u", "command": "deleteAllLeft", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+k", "command": "deleteAllRight", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+h", "command": "deleteLeft", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+d", "command": "deleteRight", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+j", "command": "dance.edit.newLine.below.insert", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+m", "command": "dance.edit.newLine.below.insert", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+b", "command": "cursorLeft", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+f", "command": "cursorRight", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+a", "command": "cursorLineStart", "when": "editorTextFocus && dance.mode == 'insert'" },
{ "key": "ctrl+e", "command": "cursorLineEnd", "when": "editorTextFocus && dance.mode == 'insert'" },
//
// Custom dance keybindings
//
// Support space menu outside of editor
{ "key": "space", "command": "dance.openMenu", "args": { "menu": "leader-hx", "pass": [{ "shift": "jump" }] }, "when": "!editorIsOpen && !inputFocus && !explorerViewletFocus" },
// Magit support in dance
// See: https://github.com/71/dance/wiki/Magit-support
{ "key": "m", "command": "dance.openMenu", "args": { "input": "magit" }, "when": "editorTextFocus && editorLangId == 'magit'" },
{ "key": "escape", "command": "runCommands", "args": { "commands": [{ "command": "dance.modes.set", "args": { "mode": "magit" } }] }, "when": "editorTextFocus && editorLangId == 'magit'" },
{ "key": "j", "command": "dance.select.down.jump", "when": "editorTextFocus && editorLangId == 'magit'" },
{ "key": "k", "command": "dance.select.up.jump", "when": "editorTextFocus && editorLangId == 'magit'" },
{ "key": "k", "command": "-magit.discard-at-point", "when": "editorTextFocus && editorLangId == 'magit'" },
{ "key": "v", "command": "-magit.reverse-at-point" },
{ "key": "x", "command": "-magit.reset-mixed" }
]