halloleo
halloleo

Reputation: 10364

In VS Code how can I put the "Show Opened Editors" action on a keyboard shortcut?

In the three dots menu of each editor group I have the "Show Opened Editors" action:

enter image description here

This shows a selection list for all the editors in the current group. How can I put this action on a keyboard shortcut? I had a look for suitable command names (like workBench.action.quickOpen, but I could not find anything for this specific selection.

However there should be a command for this: after all clicking on the "Show Opened Editors" menu entry does it...

Upvotes: 1

Views: 250

Answers (2)

Onur Doğan
Onur Doğan

Reputation: 2058

You can do it by using the View: Show Editors in Active Group By Most Recently Used (workbench.action.showEditorsInActiveGroup) command. You can edit it in 2 ways:

  1. Open the Keyboard Shortcuts panel and search it by command name as seen in this Keyboard Shortcuts Screenshot. This command has no default keyboard shortcut so, need to change its keybinding with your shortcut. Then, when you use this shortcut it shows active opened editors.
  1. As a second way, you can place it from the keybindings.json file directly. Need to click the file icon "Open Keyboard Shortcuts (JSON)" at the right top on the screenshot above. Then, you can add this command there by using these configurations:
{
   "key": "Write your shortcut combination here",
   "command": "workbench.action.showEditorsInActiveGroup"
}

Hope, it's clear and helpful

Upvotes: 1

Mark
Mark

Reputation: 180685

Use this command: workbench.explorer.openEditorsView.toggleVisibility

In a keybinding:

{
  "key": "alt+t",
  "command": "workbench.explorer.openEditorsView.toggleVisibility"
}

The first time you use it the view will be collapsed but it will remember the open/collapsed state afer that.

Upvotes: 0

Related Questions