Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter files shown in Visual Studio Code

How would you filter files shown in folder view in Visual Studio Code?

Reference: Filter files shown in folder view

like image 990
Matija Grcic Avatar asked Jul 26 '15 16:07

Matija Grcic


People also ask

How do I filter files in Visual Studio?

Filtering Files Another interesting feature of Visual Studio Code is its file filtering on the file explorer. When the focus is on the file explorer, we can start typing the file name and click on the filter. This will filter all the files in the file explorer and only show those matching the term.

How exclude files from VS Code search?

Persistent Exclusions From menu choose File ➡️ Preferences ➡️ Settings ➡️ User/Workspace Settings and filter default settings to search . You can modify the search. exclude setting (copy from default setting to your user or workspace settings). That will apply only to searches.

How do I see all files in Visual Studio Code?

VS Code allows you to quickly search over all files in the currently opened folder. Press Ctrl+Shift+F and enter your search term. Search results are grouped into files containing the search term, with an indication of the hits in each file and its location.


1 Answers

Hiding files and folders

The files.exclude setting lets you define patterns to hide files and folders from several places in VS Code like the explorer and search. Once defined, files and folders matching any of the patterns will be hidden.

{     "files.exclude": {         "**/*.js": true     } } 

Hide derived resources

If you use a language that compiles to another file at the same location of the source file, like TypeScript does to JavaScript, you can easily set an expression to hide those derived files:

"**/*.js": { "when": "$(basename).ts"} 

Such a pattern will match on any JavaScript file (**/*.js), but only if a sibling file with the same name and extension, *.ts in this example, is present. The same technique can be used for other transpiled languages, like Coffee Script or Less/Sass, too.

Source: VS Code v0.5.0 (July 2015)

like image 149
Matija Grcic Avatar answered Oct 30 '22 18:10

Matija Grcic