如何将代码片段或宏分配给 Visual Studio Code (VSC) 中的键盘快捷键?

use*_*216 4 macros keyboard-shortcuts personalization visual-studio-code

在 Dreamweaver 中,我习惯于使用自己的键盘快捷键插入代码片段。现在我正在尝试更改为 Visual Studio Code 1.2.1,但找不到任何方法来执行此操作?(我不喜欢完全智能感知的工作方式)

我找到了用于更改行为的 Key Bindings json 文件,但没有用于插入我自己的代码片段或宏的命令。

我想要实现的基本示例。

选择文本“字符串”并按Ctrl+1宏执行:
在字符串前<div>#
插入 字符串后插入#<div>

结果

<div>#string#</div>
Run Code Online (Sandbox Code Playgroud)

Ale*_*lex 5

键绑定.json >>

{
    "key": "ctrl+1",
    "command": "editor.action.insertSnippet",
    "when": "editorTextFocus",
    "args": {
        "snippet": "<div>#${TM_SELECTED_TEXT}#</div>"
    }
}
Run Code Online (Sandbox Code Playgroud)

https://code.visualstudio.com/docs/editor/userdefinedsnippets#_assign-keybindings-to-snippets