File Explorer Filter
Instantly narrow the VS Code Explorer down to only the files you're looking for.
File Explorer Filter adds a persistent filter box above your file tree. Type a
file name, a wildcard, or paste a whole list of file names, and the
Explorer tree collapses to show only the matches - with every non‑matching
folder hidden, not just greyed out or left empty.
Why File Explorer Filter
Large codebases - monorepos, multi-root workspaces, generated-code trees,
enterprise projects with thousands of files - make the built-in Explorer
tree slow to scan visually. VS Code's search view finds files, but it
doesn't reshape the tree around what you found. File Explorer Filter does:
- Find a file (or a list of files) instantly, without leaving the
Explorer or opening a separate search panel.
- See only what matters. Every folder with no match anywhere inside it
disappears from the tree - including deeply nested ones - instead of
leaving a maze of empty folders to scroll past.
- Jump straight to results. Every folder that does contain a match is
auto-expanded the moment you filter, so you never have to manually click
your way down to a result.
- Paste a list, not just one name. Got a list of files from a code
review, a ticket, or a colleague's message? Paste it in - one file name
per line - and File Explorer Filter treats it exactly like a pipe-separated
search.
Use cases
- Code review / ticket triage - paste the list of changed or affected
files from a PR description or ticket and jump straight to each one.
- Large multi-root / monorepo workspaces - filter across every root at
once, with same-named folders in different roots handled independently.
- Unfamiliar codebases - quickly narrow a huge, unfamiliar tree down to
the handful of files relevant to what you're working on right now.
- Repetitive navigation - if you find yourself opening the same handful
of files across a big project throughout the day, keep the pattern in
your filter history and reapply it in one keystroke.
Key features
- Three ways to match, auto-detected from what you type:
| You type | File Explorer Filter does |
|---|---|
|
invoice.service.ts | Live substring match as you type |
| invoice.service.ts\|payment.service.ts (pipe-separated) | Exact match on each of the listed file names |
| A pasted list, one file name per line | Treated exactly like a pipe-separated list |
| *.spec.ts or Account?.cs | Wildcard match (* and ?) |
- Auto-expand to results - matching folders open automatically; nothing
to click through manually.
- Empty folders are actually hidden - not just left visible-but-empty.
- Filter history - your last 10 patterns are remembered per workspace.
Recall them with
↑ / ↓ (just like shell history) or pick one from the
visible Recent list; delete entries you don't need individually or clear
the whole list.
- Multi-line, paste-friendly input - the filter box is a real text area,
so pasting a multi-line list of file names just works.
- Matched files are marked in the Explorer with a small indicator, so
you can spot them at a glance even while scrolling past non-matches.
- A single, consistent input surface - the File Explorer Filter: Set
Pattern command (bindable to any keyboard shortcut) focuses the exact
same filter box, so behavior never differs based on how you got there.
- Non-destructive - your own
files.exclude settings are read once and
restored exactly when you clear the filter. File Explorer Filter never
overwrites or discards your existing configuration.
How it improves your workflow
- Fewer clicks, less scrolling. Go from "where is this file" to
"there it is, expanded and highlighted" in one keystroke instead of
manually expanding folder after folder.
- Stays out of your way. No dialogs, no separate panel to manage - the
filter box lives right where you already look, at the top of the
Explorer.
- Keeps context. Filtering doesn't change your open editors, your
workspace layout, or your permanent settings - it's a temporary lens on
the tree that you can clear at any time.
- Scales to real-world repos. Built and tested against multi-root,
multi-thousand-file workspaces, not just toy projects.
Installation
- Open Extensions in VS Code (
Ctrl+Shift+X / Cmd+Shift+X).
- Search for File Explorer Filter.
- Click Install.
Or from the command line:
code --install-extension honglmn.file-explorer-filter
Usage
Open the Explorer (Ctrl+Shift+E / Cmd+Shift+E) - the Filter box sits
right above your file tree.
Type and press Enter to apply:
invoice.service.ts
Live substring match - shows every file with "invoice.service.ts" anywhere
in its name.
invoice.service.ts|payment.service.ts|refund.service.ts
Exact match on each of the three named files, wherever they are in the
workspace.
*.spec.ts
Wildcard match - every file ending in .spec.ts.
Paste a multi-line list (e.g. copied from a PR or a ticket) directly into
the box:
invoice.service.ts
payment.service.ts
refund.service.ts
Press Enter once to apply the whole list - it's matched exactly like the
pipe-separated example above.
Keyboard reference
| Action |
Result |
Enter |
Apply the filter |
Shift+Enter |
Insert a new line (for building a multi-line list) without applying yet |
Enter on an empty box |
Clear the filter |
↑ at the very start of the box |
Recall an older pattern from history |
↓ at the very end of the box |
Step back toward your newer / in-progress draft |
Recent history
Your last 10 applied patterns are listed under the filter box:
- Click a pattern to re-apply it immediately.
- Click the small ✕ on a pattern to remove just that one.
- Click Clear all to wipe the whole history.
Commands
| Command |
ID |
Description |
| File Explorer Filter: Set Pattern |
file-explorer-filter.setFilter |
Focuses the filter box (works from anywhere - bind it to a keyboard shortcut for quick access) |
| File Explorer Filter: Clear |
file-explorer-filter.clearFilter |
Clears the active filter and restores the full Explorer tree |
To add a keyboard shortcut: open Keyboard Shortcuts (Ctrl+K Ctrl+S /
Cmd+K Cmd+S), search for "File Explorer Filter", and assign the keys you want.
Settings
File Explorer Filter currently works out of the box with no configuration
required. (Have a setting you'd like to see exposed - result cap, default
match mode, keybinding presets? Open an issue - see Support
below.)
Requirements
- VS Code
1.74.0 or later.
- No other dependencies.
How it works, briefly
File Explorer Filter scans your workspace, matches file names against your
pattern, then temporarily updates files.exclude so that only matching
files - and every folder needed to reach them - remain visible. Clearing the
filter restores your original settings exactly; nothing is ever
permanently changed. Folder names containing [ or ] are handled
correctly and never misinterpreted as glob syntax.
Support
Found a bug or have a feature request? Please open an issue on the
GitHub repository.
License
MIT