Open current edit file in explorer tree

I am wondering if there is a shortcut for the VS code that highlights the decision explorer tree in the current file that opens. Like in Visual Studio:

Alt + Shift + L 
+28
source share
7 answers

I can’t live without a full answer, so I found out the following:

Without a direct keyboard shortcut:

  1. Open the command palette with Cmd - Shift - P (or Cmd + P , then > ) and type Files: Reveal Active File in Side Bar .
  2. This shows the active file in the sidebar, similar to Visual Studio Alt + Shift + L

Then take the above and match the keyboard shortcut:

  1. Open the keyboard shortcut settings file with Cmd - Shift - P and then Preferences: Open Keyboard Preferences File .
  2. Add the following (guided by Visual Studio, I personally matched it with Alt + Shift + L , but map to what you want).
 // Place your key bindings in this file to overwrite the defaults [ { "key": "shift+alt+l", "command": "workbench.files.action.showActiveFileInExplorer", }, ] 

Please note that it is not as good as Visual Studio, Atom, etc., since you cannot then navigate using the arrow keys in the tree (arrow keys move through the contents of the active file), but I assume that in the end I’ll figure out how to do it.

+35
source

I do not think that there is a command for this, but there is a shortcut to enable / disable the display of the current file when it is opened:

"explorer.autoReveal": true

+31
source

Try it:

Together with @Rob the correct answer is:

 "explorer.autoReveal": true 

then Ctrl - Shift - E (Show Explorer) focuses this file in Explorer, and the arrow keys move up / down / left / right, like any list. This works even if the conductor was closed before Ctrl - Shift - E.

Ctrl - Shift - E has the added bonus of switching focus between the selected file and its editor.

+10
source

I was able to achieve this by setting up the workbench.files.action.focusFilesExplorer command using Alt + shift + L key bindings

  1. Open the keyboard shortcuts ctrl + K + shift + S
  2. focusFilesExplorer command search & configure
  3. Indicate your key bindings that you are used to - I set Alt + Shift + L for myself
+3
source

It seems that the current version of VS Code offers a command for this feature now. In the settings, enter revealInExplorer in the search bar to find the command. There is no default binding, so just put your own. It works like a charm!

+2
source

F1 something like "open" also works from VS Code, at least for me.

+1
source

Download the extension in the browser , here it is.
Right-click> Open in the main / secondary browser and the shortcut function ALT+B / ALT+SHIFT+B will appear.

+1
source

Source: https://habr.com/ru/post/1263558/


All Articles