找不到缺少的 VS Code 1.43 键绑定来将光标键替换为文件资源管理器的 h,j,k,l(此处包含大多数其他键)



我正在努力确保在任何可以使用光标键移动选择/光标的地方,也可以使用alt+h/j/k/l。我已经在很多地方管理过它,但无法让它为文件资源管理器工作。我想用j/k上下移动。以下是到目前为止我所拥有的,这是最优的吗,以及如何添加文件资源管理器?

// Place your key bindings in this file to overwrite the defaults
[
// use alt + h, j, k and l as cursors
//
// when in textInputFocus mode move cursor
{
"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"
},
// when in listFocus mode
{
"key": "alt+j",
"command": "list.focusDown",
"when": "listFocus"
},
{
"key": "alt+k",
"command": "list.focusUp",
"when": "listFocus"
},
// when in quick open mode
{
"key": "alt+j",
"command": "workbench.action.quickOpenSelectNext",
"when": "!editorFocus"
},
{
"key": "alt+k",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "!editorFocus"
},
// when in suggestion mode
{
"key": "alt+j",
"command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
{
"key": "alt+k",
"command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
// when in smartSelect mode
{
"key": "shift+alt+l",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "shift+alt+h",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
]

答案就在这里,我复制/粘贴了最新定义中的所有光标操作,并替换为其他快捷方式:

keybindings.json

[
// textInputFocus
{
"key": "alt+k",
"command": "cursorUp",
"when": "textInputFocus"
},
{
"key": "alt+j",
"command": "cursorDown",
"when": "textInputFocus"
},
{
"key": "alt+l",
"command": "cursorRight",
"when": "textInputFocus"
},
{
"key": "alt+h",
"command": "cursorLeft",
"when": "textInputFocus"
},
// historyNavigation
{
"key": "alt+k",
"command": "history.showPrevious",
"when": "historyNavigationEnabled && historyNavigationWidget"
},
{
"key": "alt+j",
"command": "history.showNext",
"when": "historyNavigationEnabled && historyNavigationWidget"
},
// listFocus
{
"key": "alt+k",
"command": "list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "alt+j",
"command": "list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "alt+l",
"command": "list.expand",
"when": "listFocus && !inputFocus"
},
{
"key": "alt+h",
"command": "list.collapse",
"when": "listFocus && !inputFocus"
},
// explorerViewletCompressedFocus
{
"key": "alt+l",
"command": "nextCompressedFolder",
"when": "explorerViewletCompressedFocus && explorerViewletVisible && filesExplorerFocus && !explorerViewletCompressedLastFocus && !inputFocus"
},
{
"key": "alt+h",
"command": "previousCompressedFolder",
"when": "explorerViewletCompressedFocus && explorerViewletVisible && filesExplorerFocus && !explorerViewletCompressedFirstFocus && !inputFocus"
},
// notificationFocus
{
"key": "alt+k",
"command": "notifications.focusPreviousToast",
"when": "notificationFocus && notificationToastsVisible"
},
{
"key": "alt+j",
"command": "notifications.focusNextToast",
"when": "notificationFocus && notificationToastsVisible"
},
{
"key": "alt+l",
"command": "notification.expand",
"when": "notificationFocus"
},
{
"key": "alt+h",
"command": "notification.collapse",
"when": "notificationFocus"
},
// suggestWidget
{
"key": "alt+k",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "alt+j",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
// editorFocus
{
"key": "alt+k",
"command": "showPrevParameterHint",
"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
{
"key": "alt+j",
"command": "showNextParameterHint",
"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
// interactivePlaygroundFocus
{
"key": "alt+k",
"command": "workbench.action.interactivePlayground.arrowUp",
"when": "interactivePlaygroundFocus && !editorTextFocus"
},
{
"key": "alt+j",
"command": "workbench.action.interactivePlayground.arrowDown",
"when": "interactivePlaygroundFocus && !editorTextFocus"
},
// smartSelect
{
"key": "shift+alt+l",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "shift+alt+h",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
}
]

相关内容

最新更新