vscode 自定义快捷键

ctrl+k ctrl+s 打开快捷键列表,标签页最右边可打开自定义快捷键的文件。
image

内容可参考 Key Bindings for Visual Studio Code

例如:

// Place your key bindings in this file to override the defaults
[
    // 删除到头
    // 删除到尾
    {
        "key": "ctrl+shift+backspace",
        "command": "runCommands",
        "args": {
            "commands": [
                "cursorHomeSelect",
                "deleteLeft"
            ]
        },
        "when": "textInputFocus && !editorReadonly"
    },
    {
        "key": "ctrl+shift+delete",
        "command": "runCommands",
        "args": {
            "commands": [
                "cursorEndSelect",
                "deleteLeft"
            ]
        },
        "when": "textInputFocus && !editorReadonly"
    }
]
  1. 快速输入 key:快捷键列表页面搜索栏右边有个 record keys 按钮,输入按键快速生成对应文本
  2. 快速输入 command:快捷键列表页面,右键需要的快捷键命令,选择 copy command id
posted @ 2024-06-28 18:58  cliter  阅读(32)  评论(0编辑  收藏  举报