[英]Why does shift/alt keyboard combination work for default bindings but not my custom ones? (VS Code)
In Fedora Linux/Gnome and VS Code 1.36.1, the original bindings of "key": "shift+alt+right"
work fine, but I can't get my custom ones to do anything. 在Fedora Linux / Gnome和VS Code 1.36.1中, "key": "shift+alt+right"
的原始绑定可以正常工作,但是我无法让自定义的东西做任何事情。
I am adding to keybindings.json
and tried various keys. 我将添加到keybindings.json
并尝试了各种密钥。
When I use the Keyboard short cuts and recording keys
mode it picks them up fine. 当我使用键盘快捷recording keys
和recording keys
模式时,它可以很好地拾取它们。
// expand/shrink selection vim style
{
"key": "shift+alt+l",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "shift+alt+h",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
There is some kind of intermittent bug, it now works as written in the question. 有某种间歇性错误,它现在可以按照问题中的说明工作。 Here is the full config (working today) in case you want this functionality and it messes you about too! 如果您需要此功能,这里是完整的配置(今天可以使用),它也会使您感到困惑!
// Place your key bindings in this file to overwrite the defaults
[
// capslock delete
{
"key": "capslock",
"command": "deleteLeft",
"when": "textInputFocus && !editorReadonly"
},
// expand/shrink selection vim style
{
"key": "shift+alt+l",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "shift+alt+h",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
// navigate back forward position
{
"key": "alt+left",
"command": "workbench.action.navigateBack"
},
{
"key": "alt+right",
"command": "workbench.action.navigateForward"
},
// terminal style jump back and forward over words
{
"key": "alt+b",
"command": "cursorWordStartLeft",
"when": "textInputFocus"
},
{
"key": "alt+f",
"command": "cursorWordEndRight",
"when": "textInputFocus"
},
// terminal style delete back and forward over words
{
"key": "alt+capslock",
"command": "deleteWordLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+d",
"command": "deleteWordRight",
"when": "textInputFocus && !editorReadonly"
},
// Lists with vim style shortcuts
{
"key": "alt+j",
"command": "list.focusDown",
"when": "listFocus"
},
{
"key": "alt+k",
"command": "list.focusUp",
"when": "listFocus"
},
// Autosuggest with vim style shortcuts
{
"key": "alt+j",
"command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
{
"key": "alt+k",
"command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
// Quick open with vim style shortcuts
{
"key": "alt+j",
"command": "workbench.action.quickOpenSelectNext",
"when": "!editorFocus"
},
{
"key": "alt+k",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "!editorFocus"
},
// Cursor movement with vim style shortcuts
{
"key": "alt+k",
"command": "cursorUp",
"when": "textInputFocus && !suggestWidgetVisible"
},
{
"key": "alt+j",
"command": "cursorDown",
"when": "textInputFocus && !suggestWidgetVisible"
},
{
"key": "alt+h",
"command": "cursorLeft",
"when": "textInputFocus && !suggestWidgetVisible"
},
{
"key": "alt+l",
"command": "cursorRight",
"when": "textInputFocus && !suggestWidgetVisible"
}
]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.