-
Notifications
You must be signed in to change notification settings - Fork 60
/
keybindings.ts
36 lines (28 loc) · 938 Bytes
/
keybindings.ts
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
import * as vscode from "vscode";
import type { RegisterOr } from ".";
import { Context, prompt, promptMany, promptOne, todo } from "../api";
import type { Register } from "../state/registers";
/**
* Utilities for setting up keybindings.
*/
declare module "./keybindings";
/**
* Set up Dance keybindings.
*/
export async function setup(_: Context, register: RegisterOr<"dquote", Register.Flags.CanWrite>) {
await vscode.commands.executeCommand("workbench.action.openGlobalKeybindingsFile");
await _.switchToDocument(_.extension.editors.active!.editor.document);
const action = await promptOne([
["y", "yank keybindings to register"],
["a", "append keybindings"],
["p", "prepend keybindings"],
]);
if (typeof action === "string") {
return;
}
const keybindings = await promptMany([
["d", "default keybindings"],
]);
todo();
// TODO: ask whether remaining keybindings should be ignored.
}