The Need To Sync Folds in Obsidian
The Problem
I fold my notes. A lot. Headers, lists, code blocks, callouts, everything. It’s how I keep long documents manageable and my brain from melting when I’m trying to focus on one section at a time.
The problem? Obsidian stores all your fold states in localStorage, which isolates fold states to individual devices. Open the same note on any of your other devices, and everything is expanded again. Every. Single. Time.
For a while, I just dealt with it. I’d open a note, find myself frustrated that fold syncing isn’t already a feature built into Obsidian, and move on. It ultimately wasn’t that big of a deal, right?
It wasn’t until moving my Vault from iCloud to my newly built NAS that this annoyance became one I could no longer tolerate.
As part of my process of moving all my data, there were lots of times I had to recreate my Vault, thus destroying the fold states within localStorage, and necessitating the tedious process of having to go through and re-fold my entire Vault (although, made much easier due to my other fold plugin: Obsidian Fold Properties). This was a huge pain…
The Solution
So I made this plugin. It’s pretty simple, really:
- Intercepts and monkey patches all
localStorageactions related to folding - Puts them in the plugin’s
data.jsonfile (which does sync across devices) - Updates the
localStoragenecessary when you open your Vault on another device
That’s it. No complicated setup—it works out of the box. Just move the data from the thing that doesn’t sync to the thing that does.
How It Actually Works
When you load the plugin, it checks: “Hey, do I have fold states saved in settings?” If yes, it imports them into localStorage. If not, it exports whatever’s currently in localStorage so you don’t lose anything.
Then it just… watches. Every time you fold or unfold something, it saves the change to the plugin’s data.json. When that file syncs to your other devices, the plugin notices and updates localStorage there too.
Open a file, and boom—your folds are exactly where you left them. On any device.
What’s Left
I still need to make it apply fold changes to files you already have open when a sync comes in. Right now it works perfectly when you open a file fresh, but if you’ve got a note open on both devices and fold something on one, the other won’t update until you close and reopen it. Not a huge deal, but I want to fix it. I want this to be a good enough solution for the core Obsidian team to adopt it.
The rest is pretty much done. V1 is stable, settings are minified to keep the file size down, and it works with any sync solution—Obsidian Sync, iCloud, Dropbox, git, SyncThing, whatever.
Why This Matters (To Me, Anyway)
This plugin exists because I got tired of the same tiny friction point happening over and over, and it’s been a feature request since 2022. It’s not a revolutionary feature. It won’t change how you take notes. But it removes one small annoyance that was breaking my flow whenever I switched devices. I’m sure it will do the same for you.
2026-02-02: I’m currently waiting for the Obsidian dev team to approve and merge it into their repo, but you can manually install it in the meantime.
Check it out here: Obsidian Sync Folds.