Plugin: Fold / Unfold Properties in All Files

I put together a plugin that adds Fold/Unfold commands to the folder context menu. It loops through all files on the clicked folder, and also loops through children folders.

It allows you to fold (or unfold) the properties section of all the files within the selected folder. I find this beneficial for my monthly notes for example, where now I don’t have to collapse properties per file (a tedious task), I can simply right click, and click “Fold Properties”!

It’s not currently released in the community plugins as I only just spent the last hour developing it.

To install, add a folder inside .obsidian/plugins called fold-properties. Then add the main.js and manifest.json files inside this folder from: Release 0.0.1 · itsonlyjames/obsidian-fold-properties · GitHub.
Enable Fold Properties. Viola!

I will add this plugin to the community plugin list so you can download it easily, however the reviewer is currently away so it may be a few weeks.

Any issues, raise a bug in the repo!

Cheers

6 Likes

A few days ago, I was trying to add code to my vault – through JavaScript Init – to auto-fold properties in Source Mode.
I deactivated the script since.

Can you confirm you are able to register the ON and OFF fold states of individual files across multiple sessions (even after quitting and re-starting Obsidian)?

1 Like

Yeah, it persists through closing/opening, as it’s adding the fold states to local storage. Obsidian uses appId + "-note-fold-" + note in the apps local storage. My plugin saves the fold state using existing methods, and clears the relevant local storage item on unfold.

3 Likes

Sounds good.
Solves a problem, because without folding props, writing in source mode editor is twitchy if you have URLs in property values.

Would you be so kind to compile the main.js file, please so peeps can try?
Edit. My mistake, the main.js is available in releases.