Show / hide which file types to be shown in file explorer

Love the idea. I would like to treat Obsidian not only as a note taking app, but also as a hub for my research projects.

Example: I heavily use MindManager. It would be great to see and be able to “open with default app” my Mind Maps directly from Obsidian,

Andy

3 Likes

Not sure if this is universally helpful, but I’ve taken to using web-links to OneDrive URLs to link to non-MD content. If you’re using it in a consistent folder, using file:// as the markdown link will work as well.

Or .mmd, which is, sometimes, used for MultiMarkdown.

You can create a css file like the following:

div[data-path$='assets'], 
div[data-path$='assets'] + div.nav-folder-children 
{
	display: none;
}

div[data-path$='.png']{
	display: none;
}

Replace assets and .png with the folder name and extension that you want to exclude.
This is a workaround until such a feature may be integrated in some years.
(Usually you would setup this once. So that’s a workable workaround)

16 Likes

+1 for this feature request – Toggle visibility of non .md files in file explorer

Although I’ll try to work in .md formats as much as possible going forward, colleagues may not. Adding their non .md files to mine should probably not make their stuff hidden :slight_smile:

out1
Folder has 5 files but only 3 are shown. One could imagine navigation getting harder with more files – think 50 files in folder but only 30 are visible.

1 Like

+1 for this feature request

I’ve just started using obsidian and I like it so far… BUT this is a huge friction problem for me starting out. I noticed this thread is pretty old does anyone know if any solutions have been found?

Thanks,
Chris

2 Likes

Ditto here. The best I’ve found is setting up the folder where to automatically put attachments.

Settings → Files & Links → Attachment folder path

It is annoying that every time you drag an attachment in (image, pdf, etc) the attachment folder opens to show that the file is there, but it’s better than nothing. :slight_smile:

Use case or problem

I don’t use assets folders. Instead I rename all assets the same name as the file ending with a number, and put them in the same folder. If I need to move a file outside Obsidian I instantly know which other files to grab.

In Windows explorer I have a batch file that auto hides everything except the md files, and with Explorer set to “hide files” (the left column in the screenshot)I get a nice clean look of my md files, but it’s just a click of a mouse to display all hidden files if I must (the right column)

20210111_203614

I would like a similar “hidden items” type checkbox for my Obsidian navigation pane on the left. I need to display the png and jpg etc files when I first save them in my folder so that I can select them and rename them the same as the relevant md file. But once that’s done, they just all get in the way.

Proposed solution

Perhaps this is a plugin issue, in which case I trust the moderators to move my request.

The best solution is to have a simple checkbox at the top of the navigation pane where we currently have the following

image

It would just show/hide hidden items. Of course there would be a setting to determine which extensions we want to show/hide.

Current workaround (optional)

None that I can see.

Just found this similar thread: Show / hide file types to be shown in file explorer

2 Likes

Implementing something like this would be great and I think grow to a large software engineer community

Use Case
Markdown files within a code base that have ReadMe.md in subfolders or projects. I have tried this currently with Obsidian with my Home Lab and personal projects folder but it slows Obsidian way down, almost to unusable levels.

If I could put in a .obignore file just like .gitignore in git, then I could keep everything out that is just extra to the codebase.

The only thing currently available is to ignore a whole folder and that becomes way too cumbersome with multiple projects. This reason alone took me away from using the mobile version as it kept freezing up.

Hopefully this can get some traction!!
Thanks for an awesome platform thus far!

4 Likes

I was going to suggest exactly that: some way to ignore/hide folders/files using a gitignore-like syntax.

4 Likes

I know this is old, but I just spent several hours browsing the forum because I was too dense to find both of these features in settings. I don’t how long they’ve been there, but they work exactly as expected on v. 0.14.6. Wow…what devs–what a product!

1 Like

So there is a way to do this now? I cannot find it in the settings… Can you advice where to find it?

Thanks!

1 Like

The solution is you make a custom css file to config which kind of file should appear.

div[data-path$='.png']{
	display: none;
}

You can read more in this question

2 Likes

I tweaked the above css to establish the following:

  • Paste Screenshots to a Page in a folder.
  • The Screenshot File is stored in the root of the vault with Filename like “Pasted image 20221114171851.png”
  • Mark the Screenshot File in grey as a candidate for manual move.
  • Move this image file manually to the same folder as the page with the embedded folder
  • Hide the Screenshot File in the Folder to keep the File Explorer clean.

This is established by adding this css to your themes css file:

/* Hide Image Files selective */

/* Format Pasted Image in any folder and root */ 
div[data-path*="Pasted image"]{
  display: none;
}

/* Format Pasted Image in the Root */
  div[data-path^="Pasted image"]{
    color: #9999996e;
    display: flex;
  }

I am no css expert, feedback for improving the css is always appreciated.

2 Likes

Same here. I tried to hide all word documents and PDFs (backups after migrating from onenote). I just added the following in my main.css file and turned that on in preferences > appearance:

div[data-path$="docx"],
div[data-path$="docx"] + div.nav-folder-children {
  display: none;
}

div[data-path$=".pdf"] {
  display: none;
}

You can change this for any file/folder/file type! Love the fact that Obsidian is so customizable!

3 Likes

I found this post because I want to show .txt files in Obsidian. I sometimes have notes with special characters in the contents such as “[”. I don’t want to escape them with \ because I copy/paste the contents. I just don’t want Markdown enabled for the file so that it displays nicely.

I found death-au’s plugin “txt as md” in the Community Plugins, which allows .txt files to show in Obsidian, and doesn’t format them as .md files in the editor.

+1! Please, I want to keep some PSD files inside Obsidian (my second brain), I don’t need to Visualize the content of the PSDs in Obsidian, but I would like to see the file and link them, as I need to point those PSDs templates.

Here’s another CSS variation: this one hides any file that isn’t markdown. In my vault, it leaves behind a number of empty folders – still trying to figure out how to hide those.

.nav-file-title:not([data-path$='.md']) {
	display: none;
}

This should work provided you keep the folder expanded.

.tree-item.nav-folder:not(.is-collapsed):has([data-path$='.md']) {
    display: block;
}
.tree-item.nav-folder:not(.is-collapsed) {
    display: none;

:warning: Once the folder is collapsed the items inside it are removed from the dom so removing the .is-collapsed class from this snippet will hide all your folders.