Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Persistent Folded State

DanDan15 downloads

Preserves your folded and unfolded blocks and tasks in a note across external file modifications (an AI agent, another program, a git pull or a sync tool) and across quitting and relaunching Obsidian.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

An Obsidian plugin that preserves a note's block and task fold states (which headings, lists and tasks are collapsed or expanded) across the kind of external file modification that would normally reset them: an AI agent editing the file, a sync tool, a git pull, or anything else that touches the file outside Obsidian's own editor.

Status: PR-5

Restore is wired in: on a settled external edit, the plugin snapshots the stored anchors for that note, matches them against the new text (PR-4's matcher), and dispatches tagged CM6 fold effects for whatever matched — in every open pane, one settle timer and one restore pass per pane, all reading and writing the one shared FoldStore.

  • src/fold-restorer.ts — the CM6-level restore pass: snapshots stored anchors at settle time, matches with a real (not no-op) yielding scheduler, dispatches tagged fold effects, and refreshes the note's stored content hash afterwards.
  • src/restore-plan.ts — the pure planning step from (the matcher's own decision, live folded ranges, cursor position, which anchors the store still holds) to (ranges to fold now, ranges deferred until the cursor leaves them).
  • src/describe-fold.ts — now builds a real Anchor (PR-3's buildAnchors) instead of PR-2's line-local guess; a PR-2-era raw-text record is discarded on load rather than matched.
  • src/editor-watcher.ts — wires the restore pass into the settle timer and re-checks deferred (cursor-inside) targets on every later update.

Earlier PRs: PR-1 built the persistence layer (src/fold-store.ts) and a minimal UI (the "Forget stored folds for this note" command, the settings tab's "Forget all stored folds" button). PR-2 added the editor watcher, fold recording and the settle timer. PR-3 added the pure anchor builder (src/anchors.ts, src/normalize.ts). PR-4 added the pure matcher (src/matcher.ts, src/similarity.ts).

Not in this PR: the dormant-fold retry window and first-open baseline adoption (PR-6), restore on reopen/restart/rename/delete (PR-7).

Fold state is per device

Fold state is stored in this plugin's own data.json, which (like every Obsidian plugin's data.json) is local to the vault on this device and is not synced by Obsidian Sync's settings sync, nor expected to be portable across devices on its own.

Development

npm install
npm run dev     # esbuild watch build
npm run build   # typecheck + production build -> main.js
npm run lint    # eslint src
npm test        # vitest
HealthExcellent
ReviewSatisfactory
About
Preserve headings, lists, and task collapse states across external file changes like AI edits, syncs, or git operations. Restore folds by matching stored anchors to the updated text and applying fold effects in every open pane without disrupting the cursor.
EditingFiles
Details
Current version
0.1.1
Last updated
Yesterday
Created
Last week
Updates
2 releases
Downloads
15
Compatible with
Obsidian 1.13.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
DanDandanrfletcher
GitHubdanrfletcher
  1. Community
  2. Plugins
  3. Editing
  4. Persistent Folded State

Related plugins

Thino

Quickly capture memos and display them in the sidebar with a heatmap. (Closed source)

Gemini Scribe

Allows you to interact with Gemini and use your notes as context.

Remember cursor position

Remember cursor and scroll position for each note.

Code Space

Professional code file management with visual dashboard, syntax highlighting editor, Markdown embedding, external folder mounts, and terminal integration.

Note Refactor

Extract note content into new notes and split notes.

Notebook Navigator

A better file browser and calendar inspired by Apple Notes, Bear, Evernote and Day One.

Claudian

Embeds Claude Code/Codex and other local Agents as AI collaborators in your vault.

LanguageTool Integration

Advanced grammar and spell checking, powered by LanguageTool.

Meta Bind

Make your notes interactive with inline input fields, metadata displays, and buttons.

Advanced URI

Control everything with URI.