Advanced Exclude

approved

by Michael Naumov

Enhances the Excluded files setting bringing gitignore syntax. - This plugin has not been manually reviewed by Obsidian staff.

69 stars16,804 downloadsUpdated 19d agoMIT

Advanced Exclude

Buy Me a Coffee GitHub release GitHub downloads Coverage: 100%

Obsidian's Files and links > Excluded files setting does less than its name suggests: excluded files still sit in the Files pane, still turn up in Backlinks, still appear in search. They are de-emphasized, not excluded.

This plugin makes them behave as though they are not there, and lets you say which ones with gitignore syntax — the pattern language you already know — from a .obsidianignore file, your existing .gitignore, or Obsidian's own setting.

[!WARNING]

The plugin makes Obsidian behave like the ignored files do not exist. This might affect features like Obsidian Sync, Obsidian Publish, etc.

Ensure you configured the plugin correctly to avoid data loss.

Excluded files still sit in your file explorer

More screenshots
One gitignore line later, they are not there at all Excluded files still sit in your file explorer One gitignore line later, they are not there at all

Demo vault

The documentation is a demo vault. Every feature has a note that explains what it does and why you would want it, with folders already in place to hide and un-hide.

Start reading here — it is plain markdown, so it works on GitHub with nothing installed.

A copy of the vault ships with every release. You can access it via any of the following:

  1. Running the Advanced Exclude: Open demo vault command.
  2. Downloading advanced-exclude-demo-vault.zip from the Releases. It unzips into a single advanced-exclude-demo-vault-<version> folder.
  3. Browsing its source in demo-vault/ in this repository.

What it does

  • Exclude with gitignore syntax — a folder, an extension, a path, from a .obsidianignore file you can edit by hand. 01 Exclude a folder
  • Whitelist instead of blacklist, including the negation trap that catches most people: once * ignores everything, folders must be re-included with !*/ before any !file rule can reach inside them. 02 Whitelist with negation
  • Choose where patterns come from and how hard they hide — your .gitignore, Obsidian's own Excluded files setting, and how completely an ignored file disappears. Both extra sources are off by default, so a fresh install changes nothing until you turn one on. 03 Exclude mode and sources
  • Hide folders left empty by exclusion, cascading up through parents whose whole subtree went away. Genuinely empty folders stay visible. 04 Settings

Installation

The plugin is available in the official Community Plugins repository.

Beta versions

To install the latest beta release of this plugin (regardless if it is available in the official Community Plugins repository or not), follow these steps:

  1. Ensure you have the BRAT plugin installed and enabled.
  2. Click Install via BRAT.
  3. An Obsidian pop-up window should appear. In the window, click the Add plugin button once and wait a few seconds for the plugin to install.

Debugging

By default, debug messages for this plugin are hidden.

To show them, run the following command in the DevTools Console:

window.DEBUG.enable('advanced-exclude');

For more details, refer to the documentation.

Changelog

All notable changes to this project will be documented in the CHANGELOG.

Contributing

Contributions are welcome — see CONTRIBUTING to get set up.

Support

Buy Me A Coffee

My other Obsidian resources

See my other Obsidian resources.

License

© Michael Naumov

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.