Ignore/exclude completely files or a folder from all obsidian indexers and parsers

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.

2 Likes

+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.

3 Likes

That is only a workaround, which works differently on each platform, think mobile or windows (where SymLinks have to be enabled by an Admin).
We need something built-in that works the same across all platforms.

2 Likes

+1 here; I’d love to use obsidian to connect all of the projects and notes in my PhD work - many of which are repositories themselves with i.e. node_modules/ … I’ve used regex to ignore most of these but obsidian still sucks down 5gb of RAM and has to re-index 14k files each time I open it, then has boggy performance afterwards.

I would second a kind of .obsidianignore file type, that seems like a smart and well-understood solution, though perhaps just by the git-folks community.

4 Likes

Maybe I misunderstood something from that post and this feature but after facing the same issue with docusaurus and hugo projects I took the problem from a different perspective.

With docusaurus where I simply bind my mardown directory (in that case) ./blog ./docs and ./src in my Obsidian Vault which give something like this

  • Obisidian Vault = $HOME/Vaults/*
  • Static Website = $HOME/Public/*
sudo mount -B $HOME/Vaults/website.tld/blog $HOME/Public/website.tld/blog
sudo mount -B $HOME/Vaults/website.tld/docs $HOME/Public/website.tld/docs
sudo mount -B $HOME/Vaults/website.tld/src $HOME/Public/website.tld/src

and so; obviously it is tight to the user (via a script) or the machine (via /etc/fstab) but it works well

1 Like

Out of my head, it is also possible to relay on git and is submodule power
like in both project
Obsidian and Hugo you have a git repo for them and the content of your post are managed as a submodule of them

GitSlave is apparently the new way of doing git submodule with frequently update https://gitslave.sourceforge.net

I want to bump this. My use-case is similar to many other developers - I want Obsidian as my documentation format that lives right there in the repo with the source files.
Problem is, my tools generate tens of thousands of service/cache files, multiple GBs total, and when that happens - Obsidian REFUSES TO LOAD completely.

Of course because the third-party infrastructure is closed-source I can’t just rename the folder with a leading “.” - that will break the project. Dancing around with symlinks, or having project source in one submodule, obsidian vault in another is very unpleasant to work with. I think a setting to exclude folders from Obsidian’s consideration completely is needed - tools are more powerful when they can work together.

5 Likes

I store some code in the same folder as my Obsidian vault and at one point had a build artifact with the same name as one of my notes (but without the .md) extension. This meant that when I tried to open the note via a Wikilink it would open the “Open With” menu, because it thought I wanted this build artifact that Obsidian can’t open anyway. Very strange behavior, and would be easy to solve if I could just exclude the whole folder completely from Obsidian as suggested here.

1 Like

Use case or problem

Some my notes and folders contain a lot of junk text, guides, chapters from books and so on. When searching all this text pollutes search results.
I know about “path:-” and “Settings > Files & Links > Excluded files” but these are inconvenient or not working solutions for daily use.

Proposed solution

Add to “Settings > Files & Links > Excluded files” analogue “Completely excluded files”

6 Likes

I second that! We would like to set up an obsidian Vault in our development project root Folder and we have 90% non-markdown Files in there, which clutters the Folder View (I know I can change the CSS) and makes Obsidian Operations unbearably slow.
I second this idea of excluding specific Extensions (or including only specific ones) using Glob Pattern similar to .gitIgnore.

2 Likes

As far as I understand, this is a duplicate of

[link outdated, the mods merged everything here.]

2 Likes

Honestly, I don’t understand what is standing in the way of being able to exclude directories and files completely from Obsidian’s awareness. There’s a whole, broad use case waiting to be tapped - that of developers, development teams and their markdown knowledge bases across their git repositories.

Literally all that’s missing is being able to ignore dirs like node_modules or dist or .git.

The perfect solution would be to support .obsidianignore and/or perhaps optionally respect .gitignore files.

7 Likes

+1 to this feature, the current implementation completely rules out many use cases of obsidian for developers

2 Likes

Do we have any progress, update, workaround, plugin or solution on this issue?

I’m wondering whether running obsidian as a different user and restricting access for certain folders could be a workaround.
Obsidian would simply be unable to parse or index these.
That would require preserving file extended attributes across sync solutions, but may be feasible.

I really appreciate obsidian. Thanks for this great piece of foss!

1 Like

I also really want this feature. I am using Obsidian with Quarto, and it generally works really well, except Obsidian messes with folders that are intended just for Quarto.

1 Like

I’m having the same issue. If I have a node_modules folder within my vault, Obsidian becomes very slow and it becomes completely unusable (it remains stuck to the “loading workspace” screen).

I don’t understand why this feature is being neglected by the development team. Introducing a .obsidianignore file would be extremely easy and effective.

I don’t want to store my project files outside the vault. I’d rather ditch out Obsidian for another app that does not have this limit.

1 Like

I’m trying to install some npm packages to help me format my dataviewJS folder (which is growing into a bit of a repository since I started using CustomJS) however the node_modules folder immediately caused a ton of issues

This feature would be great

1 Like

Me, too. I need this feature. Thanks!