VS Code 个人常用快捷键配置

116 阅读1分钟

步骤

  • 打开 VS Code 命令栏(View -> ), 输入 Open Keyboard Shortcuts, 选 Json 项

    打开 VS Code 命令栏

    image.png

    输入 Open Keyboard Shortcuts, 选 Json 项

    526169e94ab15c90dc975e017e97fb09.jpg

  • 修改对应配置快捷键

    213db8f5fa71e6a04f7c9e36ada53107.jpg

个人配置附录

向下复制一行

    {
        "command": "editor.action.copyLinesDownAction",
        "key": "shift+alt+down",
        "when": "editorTextFocus && !editorReadonly"
    }

删除一行

    {
        "command": "editor.action.deleteLines",
        "key": "ctrl+d",
        "when": "textInputFocus && !editorReadonly"
    }

提示信息回车上屏

    {
        "command": "acceptSelectedSuggestion",
        "key": "[Enter]",
        "when": "suggestWidgetVisible && textInputFocus"
    },
    {
        "command": "acceptSelectedSuggestion",
        "key": "[Enter]",
        "when": "acceptSuggestionOnEnter && suggestWidgetVisible && suggestionMakesTextEdit && textInputFocus"
    }

参数提示信息

可能快捷键设置不生效,可能是与 VS Code 本身快捷键冲突, 移除即可, 比如设置为 ctrl+q 与 show hover 冲突了, 移除 show hover 快捷键

    {
        "command": "editor.action.triggerParameterHints",
        "key": "ctrl+q",
        "when": "editorHasSignatureHelpProvider && editorTextFocus"
    }

效果

image.png