How to display hidden files with Visual Studio Code
MacosVisual Studio-CodeMacos Problem Overview
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:
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?
Macos Solutions
Solution 1 - Macos
On Mac you can hit cmdshift. in the open file dialog, to see hidden files.
(Source)
Solution 2 - Macos
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
Solution 3 - Macos
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:
Solution 4 - Macos
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.
Solution 5 - Macos
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"
Solution 6 - Macos
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.
Solution 7 - Macos
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.
Solution 8 - Macos
In menu View in Visual Studio Code, select SCM (shortcut Ctrl + Shift + G), right click on the Git icon, click here and select Keep.