Actually excluding paths from Obsidian entirely

So I’m aware of the Files & Links > Excluded files feature, and have seen several other threads here discussing specific needs like excluding a path from quick view results, but not addressing a general need to make certain paths invisible to Obsidian entirely.

Use case or problem

I want to use Obsidian to manage / author documentation in my git repos for various development projects. The git repos would exist as subdirectories (submodules) underneath my Obsidian vault. I plan to use the Obsidian Git plugin to sync.

The problem is that in the git repositories, my other working files also exist and Obsidian looks at all of them, everywhere. I really only want Obsidian to deal with markdown files and selected other files. Attachments would specifically be stored under attachments dirs.

The result of this is that Obsidian indexes thousands of files that I don’t care about… like READMEs in node_modules etc… and it ends up unusably slow. To the point where file operations take upwards of 10s to complete.

I imagine that this is a fairly huge blocker for any developer who wants to seriously use Obsidian to support documentation in their working repositories, which is where Obsidian would really shine - documentation is often hard to make sense of in dev repos.

I’m happy to tell Obsidian where to look or not look. I’ve already configured the Excluded files feature with Regex accordingly, but it seems to make no difference to what Obsidian indexes.

Proposed solution

The .obsidianignore file that was recommended in another thread is a great idea.

Another option is to enable a ‘Whitelist’ mode, where Obsidian starts off indexing nothing, and you specifically give it paths in glob syntax to include.

Also, configuring Obsidian to respect .gitignore would be incredibly useful.

Current workaround (optional)

I haven’t found a way around this. I’ve tried the existing features (that I know about) to no avail.

Related feature requests (optional)

2 Likes

I wonder if you could create a symbolic link tree that filters out what you don’t want.
Check out some solutions at bash - Create symlink tree in existing directories - Unix & Linux Stack Exchange

Hmm, that’s actually a really interesting idea…

Off the top of my head, symlinks can’t filter the contents they are symlinking to, or be overlayed, so it would require the duplication of the repo’s directory structure in the Obsidian vault, and the symlinking of each individual file that’s to be included.

Also look at overlayfs which is mentioned in your link, but that also seems to lack the ability to filter paths that are overlayed.

It’s an interesting direction to go…

Still would be far simpler having a .obsidianignore file and respecting .gitignore.

+1 from my side. In my case I’d like to have some 3rd party tools in the vault which require symlinks to system files which require special previleges. This is even worse than long waiting times for commands, since Obsidian simply fails indexing all the files at startup, reports an error and dies. Having the option to truely ignore files and folders would thus be very helpful.
I think both a toggle in the Excluded files list and .obsidianignore files would be good solutions. As a git person, I favor the latter but have to admit that the former better fits the feel of obsidian.