簡體   English   中英

找不到丟失的 VS Code 1.43 鍵綁定,以將光標鍵替換為文件瀏覽器的 h、j、k、l(此處包含的大多數其他鍵)

[英]Can't find missing VS Code 1.43 key bindings to replace cursor keys with h,j,k,l for the file explorer (most others included here)

我試圖確保在任何可以使用光標鍵移動選擇/光標的地方,您也可以使用 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"
  }
]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM