How to reveal the current File in Explorer in VS Code

avatar
Borislav Hadzhiev

Last updated: Apr 6, 2024
2 min

banner

# Reveal the current File in Explorer in VS Code

You can use a keyboard shortcut to reveal the current File in Explorer in VS Code:

  • on Windows and Linux, press Ctrl + Shift + E.
  • on macOS, press Cmd + Shift + E.

reveal file in explorer keyboard shortcut

You can view the Show Explorer / Toggle Focus keyboard shortcut for your operating system in this section of the docs.

# Reveal the current File in Explorer using the Command Palette

Alternatively, you can use the Command Palette:

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: you can also press F1 to open the Command Palette.
  1. Type reveal file and select File: Reveal Active File in Explorer View.

vscode reveal current file in explorer

# Reveal the current File in Explorer by right-clicking on it

You can also right-click on the name of the file at the top and select Reveal in Explorer View.

right click reveal in explorer

You can also right-click on the file in source control and select Reveal in Explorer View.

right click in source control and reveal

# Open the containing folder of the file

If you need to open the folder that contains the file, right-click on it and select Open Containing Folder.

open containing folder

The command might be Open in Finder, or something similar, on macOS.

# Setting a custom keyboard for the Reveal file in Explorer command

If you need to set a keyboard shortcut for the Reveal file in Explorer command:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Keyboard Shortcuts and select Preferences: Open Keyboard Shortcuts.

preferences open keyboard shortcuts

  1. Type reveal file explorer in the search field and double-click on the File: Reveal Active File in Explorer View.

reveal active file in explorer custom keyboard shortcut

  1. Double-click on the row, specify a key combination and press Enter.

You can also click on the row and then click on the plus icon to set a keyboard shortcut.

For example, you can use a keyboard shortcut like Ctrl + F4 (or Cmd + F4 on macOS).

reveal current file ctrl f4

I've also written an article on how to collapse all folders in Explorer in VS Code.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.