Button to show/hide filetypes in File Explorer

I would like a toggle button at the top of file explorer that would “show” or “hide” filetypes.
There would be a settings option that would include something like the following:

When in “hide” mode, hide the following:

  • all image types; or
    • jpg
    • png
    • etc…
  • all non-md filetypes; or
    • pdfs
    • txt
    • zip
    • etc

Extra option

  • Do not hide files created ____ (where the choice could be “today” or “in the last x hours”). This is so that we have time to rename imported images or attachments without having to toggle on and off before doing so.

It would be brilliant if it could also include other files by tag or by folder name. Example:
When in “hide mode”, hide the following:

  • files with tag x (#archive for example); and/or
  • folders that start with “Archive” (or that contain “Archive”, that sort of thing.

Requests relevant to this:
https://forum.obsidian.md/t/option-to-display-hide-filetypes-in-navigation-bar-on-the-left/11328

1 Like

I use the following css snippet until this feature is implemented:

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

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

Modify the extension accordingly. Of course not as useful as a built-in button as you suggest, but still better than nothing in the meantime.

2 Likes

tb87, I like to keep all my files together so I don’t use assets or other folders to ‘hide’ my attachments. (I’m real big on ensuring I can see everything in Windows explorer; all related files begin with the same name so if I move something I know all the files to move with it).

I suppose I could use the second part of your code, but the idea of going into settings, appearance, and enabling/disabling the snippet multiple times/day would try what little patience I have.

Good work-around for those who don’t need to keep changing the setting though.

I have a lot of different file types in my vault that I want hidden. To include everything except .md, files, I use this CSS snippet. If you want to add extra files, add another selector like: :not([data-path$='.png']).

div[data-path]:not([class='nav-folder-title']):not([data-path$='.md']){
	display: none;
}
1 Like

Made an account just to say, thank you for this Mestoffeles. The files showing up on the left were frustrating for me.

I don’t know CSS, and this was the first file I ever made (super easy)! It worked like a charm.

For anyone else here off of google, just copy and paste his code into a notepad document, and save it as a " .css " file

1 Like