166

The "open file" dialog in Visual Studio Code is not showing hidden files. For example, when looking at my home directory, none of the . files are shown:

Enter image description here

I did look through the settings.json file, but I did not find any applicable setting. So - how do I configure Visual Studio Code properly?

11 Answers 11

223

On Mac you can hit cmdshift. in the open file dialog, to see hidden files.

(Source)

7
  • 3
    Yes it is a general mac thing.
    – Khanna111
    Jul 18, 2018 at 19:07
  • 1
    The windows explorer has a hidden items setting under View (win 10). This enables showing hidden files everywhere. Not sure if you can toggle in a dialog like on MacOS Nov 16, 2018 at 19:40
  • Do you have any reference for "general mac things" keyboard shortcuts like this? Feb 23, 2019 at 15:22
  • 2
    Wow. I've been using OS X for > 10 years and never knew that. Well played!
    – sming
    May 2, 2019 at 14:19
  • 3
    In case you are using Ubuntu, Ctrl+O and then right click on any of the file and check "Show Hidden Files"
    – sotmot
    Sep 22, 2021 at 16:21
130

go to file -> preferences -> settings

and in the search bar, search for "files.exclude"

then delete whatever json setting that you don't want to hide that specific file

3
  • 17
    although not related to the open file window, this allows the file to be displayed on the side panel. I was looking for this answer, thanks!
    – Doug
    Nov 27, 2020 at 1:19
  • 1
    Its Code -> Preferences -> Settings
    – Magnuti
    Aug 25, 2022 at 14:55
  • 3
    Does not address the question. Mar 5 at 20:29
39

Under Linux you can right click on files in the file selection window and check the "Show Hidden Files" checkbox.

Here's a screenshot from Ubuntu 20.04.1 LTS, VS Code v 1.52.1 after right clicking on the header.php file with "Show Hidden Files" option enabled: Linux VS Code Open File Dialogue Box Hidden Files Option

3
  • 2
    That works, thanks! We can also type . to open a text dialog, which offers suggestions and autocomplete. Sep 12, 2019 at 17:05
  • 1
    in other words File, Open File or File, Open Folder have the the option to right click which brings up a dialog box that includes Show Hidden File.
    – JohnC
    Mar 1, 2020 at 12:58
  • 1
    I know this is an old question, but this solution is not persistent. When opening back a file selection window the checkbox is unmarked.
    – Tox46
    Sep 16, 2021 at 17:00
20

On Windows, in VS Code, go to File > Preferences > Settings.

Search file.exclude and hover over the hidden files you want to see and click the "X"

Figure 1

Figure 2

1
  • 2
    Not a direct answer to the question but useful anyways Oct 31, 2021 at 6:23
13

To display hidden .git directories in Visual Studio Code, do the following:

On Windows or Linux, select File → Preferences → Settings.

On Mac, select Code → Preferences → Settings.

In Visual Studio Code settings (Settings Editor), select Editor → File and scroll to (or search for) Exclude. Comment out the glob to exclude .git files (// **/.git). See the attached screenshot: VS Code glob commenting.

Also see Visual Studio Code User and Workspace Settings. You will find the default settings on the page, which you could edit, but I chose to comment the glob out to conveniently hide these files later should I so desire.

Visual Studio Code: Show hidden folders contains more information on the subject.

2
  • Does not answer the question which is about the open file dialog, not about what files are available in the explorer view Mar 5 at 20:28
  • The last link is behind a paywall. Apr 13 at 21:51
4

Linux:

ctrl + ","

in search, type: "files exclude"

This shows all the patterns VS Code uses when deciding what to ignore. If you wanted to view a .git folder, you would simply remove that pattern from the list of patterns "**/.git". When you want to stop seeing it, just add that pattern back.

3

On Windows, open the .vscode folder in the explorer and comment out the file types you wish to see. There is no need to restart VS Code, just click the refresh explorer button.

enter image description here

0
1

Alternately, you can edit your settings.json file directly to always show .git files.

enter image description here

0

If anyone wants a quick way to toggle the visibility of hidden files, you can use an extension:

  1. Peek Hidden Files:

Toggle the visibility of excluded files by Explorer's context menu. I'm currently using this one.

  1. Make Hidden:

Has a context menu option to hide selected items in Explorer. Has an area to view hidden files.

  1. Explorer Exclude:

Can control hidden file glob patterns without going to settings.json. preview image

-1

In case if you are wondering how to do it in Visual Studio (NOT VS CODE) for mac.

  1. Open Visual Studio in mac
  2. Right click on your solution in Visual Studio
  3. Display Options -> Show All Files

bin and obj files should be display.

enter image description here

-3

In menu View in Visual Studio Code, select SCM (shortcut Ctrl + Shift + G), right click on the Git icon, click here and select Keep.

3
  • 1
    How is "Keep" and hidden files related? Dec 15, 2019 at 13:18
  • Where is the "Keep" item? Perhaps provide a screenshot? Dec 15, 2019 at 13:19
  • This is only about hiding or showing the Source Control pane and has nothing to do with the question. Jul 8, 2020 at 9:53

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.