You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Visual Studio Code中分别绑定自动换行的开启/关闭快捷键?

VS Code 为自动换行开启/关闭设置独立快捷键

你之前的配置无效是因为快捷键绑定不能直接设置配置项,得通过对应的命令来修改配置。正确的做法是使用workbench.action.settings.editor.setSetting命令,分别给开启和关闭绑定快捷键,配置如下:

[
    {
        "key": "ctrl+shift+alt+q",
        "command": "workbench.action.settings.editor.setSetting",
        "args": {
            "settingId": "editor.wordWrap",
            "value": "on"
        }
    },
    {
        "key": "ctrl+shift+alt+e",
        "command": "workbench.action.settings.editor.setSetting",
        "args": {
            "settingId": "editor.wordWrap",
            "value": "off"
        }
    }
]

把这段配置添加到你的快捷键配置文件(keybindings.json)里就可以生效了。操作步骤:按下Ctrl+K Ctrl+S打开快捷键面板,点击右上角的「打开键盘快捷方式(JSON)」图标,将上述内容粘贴进去保存即可。

内容的提问来源于stack exchange,提问作者icecream sugar black

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 04:54:24