Не удается найти отсутствующие привязки клавиш VS Code 1.43 для замены клавиш курсора на h, j, k, l для проводника файлов (большинство других включено здесь) - PullRequest
0 голосов
/ 13 марта 2020

Я пытаюсь убедиться, что везде, где вы можете использовать клавишу курсора для перемещения выделения / курсора, вы также можете использовать 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"
  },
]

1 Ответ

0 голосов
/ 13 марта 2020

Ответ здесь, я скопировал / вставил все действия курсора из последнего определения и заменил его на дополнительный ярлык:

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"
  }
]
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...