我只需在
keybindings.json
文件中添加新键即可覆盖 VS Code 中的任何键盘快捷键。
但是我无法删除现有的快捷方式。更具体地说,我想删除这个:
{ "key": "ctrl+alt+down",
"command": "editor.action.insertCursorBelow",
"when": "editorTextFocus" }
关于如何删除它有什么想法吗?
这在我们的按键绑定文档中有介绍。只需在命令名称前添加
-
即可。
对于您的示例,请尝试添加:
{ "key": "ctrl+alt+down", "command": "-editor.action.insertCursorBelow" }
致你的
keybindings.json
这应该删除按键绑定。
事实上,在幕后这也会编辑你的
keybindings.json
。
要查看效果,打开键盘快捷键后,单击具有鼠标悬停文本的图标 Open Keyboard Shortcuts (JSON)
:
如果您需要更多帮助,请尝试:
https://code.visualstudio.com/docs/getstarted/keybindings#_advanced-customization
用空命令覆盖它似乎可以解决问题:
{ "key": "ctrl+alt+down", "command": "",
"when": "editorTextFocus" }
File
> Preferences
> Keyboard Shortcuts
-或-
Ctrl+K,Ctrl+SCode
> Preferences
> Keyboard Shortcuts
-或-
macOS 上为 ⌘K、⌘S)。Ctrl
+ Alt
+ DownArrow
)。Remove Keybinding
。这会编辑您的
keybindings.json
。
要查看它,请单击右上角的图标,如下所示
下面(工具提示 = Open Keyboard Shortcuts (JSON)
):
如果您需要更多帮助,请尝试:
https://code.visualstudio.com/docs/getstarted/keybindings#_advanced-customization