README file from
GithubHide Folders and Files
An Obsidian plugin that hides configured folders and files in the file explorer, with a quick toggle to show them again.
Based on obsidian-hide-folders by JonasDoesThings (MIT). This version adds a separate list for files, a shared matching engine, and a set of fixes (see below).
Configuration
The settings page has two separate sections, Folders and Files. Each has its own list (one entry per line), its own on/off toggle and its own "add to Obsidian exclusion list" option.
Each line can be:
- an exact name:
attachments(folders) orsecret.md(files, include the extension) startsWith::PREFIX: for examplestartsWith::_hides everything whose name starts with_endsWith::SUFFIX: for exampleendsWith::.pnghides every PNG
"Ignore upper/lowercase" applies to both lists. Blank lines are ignored.
Toggling
- Ribbon button: toggles folders and files together.
- Commands: Toggle visibility of hidden folders, …hidden files, …hidden folders and files.
Exclusion list
With the exclusion-list option on, hidden items are also added to Obsidian's Files and links → Excluded files, so they disappear from search, graph view and unlinked mentions. The plugin removes only the entries it added. Turn the option off before disabling the plugin if you want them removed.
What changed from the original
- New: hide files, with a separate list, toggle and exclusion-list option.
- Names are matched in code instead of being put into CSS selectors, so quotes or brackets in a name no longer break hiding.
- Un-hiding is complete: removing an entry or turning hiding off shows the item again without a reload, and disabling the plugin un-hides everything.
- The settings toggle now updates the ribbon icon and status bar.
- Exclusion-list entries are regex-escaped and anchored to path segments, and only entries this plugin added are removed.
- Settings page uses the declarative settings API on Obsidian 1.13.0+, with a
display()fallback for older versions. - Corrupt or hand-edited
data.jsonvalues fall back to defaults. - Removed
@ts-ignore,innerHTMLand the external image; added strict lint and CI.
Known limits
- Quick Explorer compatibility (experimental) covers folders only.
- The plugin has not yet been tried in a real Obsidian; see
CLAUDE.mdfor what has and has not been verified.
Development
pnpm install, thenpnpm dev(watch) orpnpm build(one-off, writesdist/).pnpm lint,pnpm lint:strict(CI, zero warnings),pnpm lint:scanner(community scanner approximation).- Copy
dist/main.js,manifest.jsonandstyles.cssto<vault>/.obsidian/plugins/hide-folders-and-files/.
Licence
MIT, see LICENSE.md. Original copyright remains with its author.