Hide Folders and Files

by Anthirayas
5
4
3
2
1
Score: 50/100

Description

Obsidian plugin that hides folders and files in the file explorer, with separate lists and a quick toggle. Based on obsidian-hide-folders.

Reviews

No reviews yet.

Stats

0
stars
97
downloads
0
forks
20
days
21
days
21
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
4
commits

README file from

Github

Hide 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) or secret.md (files, include the extension)
  • startsWith::PREFIX: for example startsWith::_ hides everything whose name starts with _
  • endsWith::SUFFIX: for example endsWith::.png hides 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.json values fall back to defaults.
  • Removed @ts-ignore, innerHTML and 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.md for what has and has not been verified.

Development

  • pnpm install, then pnpm dev (watch) or pnpm build (one-off, writes dist/).
  • pnpm lint, pnpm lint:strict (CI, zero warnings), pnpm lint:scanner (community scanner approximation).
  • Copy dist/main.js, manifest.json and styles.css to <vault>/.obsidian/plugins/hide-folders-and-files/.

Licence

MIT, see LICENSE.md. Original copyright remains with its author.