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

Foldstate

samhopwellsamhopwell89 downloads

A plugin that persists heading fold state across devices and sessions by embedding fold markers directly in your markdown files.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

An Obsidian plugin that persists heading fold state across devices and sessions by embedding fold markers directly in your markdown files.

The problem

Obsidian stores fold state in localStorage, which means it's lost when you switch devices, reinstall the app, or use any sync tool (iCloud, Git, Obsidian Sync, etc.). Every time you open a note on a new device, all your headings are expanded.

How it works

When you fold a heading, the plugin appends %% fold %% to that line:

## My Section %% fold %%

Content hidden when folded...

## Another Section

Content always visible...

%% %% is Obsidian's native comment syntax — the marker is invisible in Reading view and syncs with your file via any tool you already use.

When you open a note, the plugin reads the markers and restores the fold state automatically. No manual steps, no separate state files.

Features

  • Saves fold state on every fold/unfold — no manual save needed
  • Restores state when you open a file
  • Works with any sync tool (iCloud, Git, Dropbox, Obsidian Sync, etc.)
  • Markers are hidden in Reading view
  • No settings to configure

Installation

Manual installation

  1. Download main.js and manifest.json from the latest release
  2. Create a folder at <your vault>/.obsidian/plugins/obsidian-foldstate/
  3. Copy both files into that folder
  4. Open Obsidian → Settings → Community plugins and enable Foldstate

Requirements

  • Obsidian 1.4.0 or later
  • Live Preview or Source mode (fold state is not tracked in Reading view)

The marker format

The marker %% fold %% is appended to heading lines:

Mode Appearance
Source / Live Preview ## My Heading %% fold %%
Reading view My Heading (marker hidden)

The marker only appears on headings that are currently folded. Unfolding a heading removes it automatically.

Development

# Install dependencies
npm install

# Build in watch mode
npm run dev

# Production build
npm run build

# Run tests
npm test

To test locally, copy main.js and manifest.json to .obsidian/plugins/obsidian-foldstate/ in a test vault and enable the plugin.

Contributing

Bug reports and pull requests welcome at github.com/samhopwell/obsidian-foldstate.

77%
HealthExcellent
ReviewSatisfactory
About
Persist heading fold state across devices and sessions by inserting %% fold %% comment markers into headings. Restore fold state automatically when opening notes; markers stay hidden in Reading view and travel with your files via any sync tool.
MarkdownFilesEditing
Details
Current version
1.0.0
Last updated
3 months ago
Created
3 months ago
Updates
1 release
Downloads
89
Compatible with
Obsidian 1.4.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
samhopwellsamhopwell
GitHubsamhopwell
  1. Community
  2. Plugins
  3. Markdown
  4. Foldstate

Related plugins

Outliner

Work with your lists like in Workflowy or Roam Research.

Various Complements

Complete words similar to auto-completion in an IDE.

Remember cursor position

Remember cursor and scroll position for each note.

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.

Note Refactor

Extract note content into new notes and split notes.

Advanced Tables

Improved table navigation, formatting, and manipulation.

Notebook Navigator

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

Local REST API & MCP Server

Unlock your automation needs by interacting with your notes over a secure REST API.

QuickAdd

Quickly add new notes or content to your vault.