209

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?

12 Answers 12

259

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

(Source)

Sign up to request clarification or add additional context in comments.

9 Comments

Yes it is a general mac thing.
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
Wow. I've been using OS X for > 10 years and never knew that. Well played!
In case you are using Ubuntu, Ctrl+O and then right click on any of the file and check "Show Hidden Files"
This change isn't persistent though. Isn't there a way to change this permanently so you don't have to cmd+shift+. every time?
|
185

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

6 Comments

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!
Its Code -> Preferences -> Settings
Does not address the question.
@PaulChilds Yes it does. The topic was "How to display hidden files with Visual Studio Code". The top answers actually talk about displaying hidden files within certain OSes, namely Ubuntu and MacOS. This is the first one to talk about displaying hidden files in VSCode itself.
The question is clearly tagged macos. If perchance someone had an exclusion filter for hidden files then this would fix it, but not for the OP and the majority of people searching where it is due to the OS excluding them from the dialog.
|
44

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 Comments

That works, thanks! We can also type . to open a text dialog, which offers suggestions and autocomplete.
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.
I know this is an old question, but this solution is not persistent. When opening back a file selection window the checkbox is unmarked.
34

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

3 Comments

Not a direct answer to the question but useful anyways
Also don't forget to check "workspace" tab.
@WestCoastProjects This is the only answer that directly answers the question "How to display hidden files with Visual Studio Code"
14

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 Comments

Does not answer the question which is about the open file dialog, not about what files are available in the explorer view
The last link is behind a paywall.
6

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.

Comments

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

Comments

2

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

enter image description here

1 Comment

To add: I needed to use Command Palette (Ctrl + Shit + P) -> Edit user settings and then search for exclude files.
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

Comments

-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

Comments

-2

On windows terminal, first time I using ls -a command tò see hidden files but it show conflicts and error, check image below.

I have done this by using ls-hidden command. to see hidden files in windows terminal type:-1. ls-hidden 2. Press Enter. it will show hidden files. Thanksenter image description here

Comments

-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 Comments

How is "Keep" and hidden files related?
Where is the "Keep" item? Perhaps provide a screenshot?
This is only about hiding or showing the Source Control pane and has nothing to do with the question.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.