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

Logseq Style Fold

马自立马自立1 downloads

Remember how list items are folded by writing a Logseq-style collapsed:: true line into the note, hidden from view. The marker text is configurable.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

Your lists stay folded the way you left them — written the way Logseq writes it.

An Obsidian plugin that remembers how each list item was collapsed, by writing a Logseq block property into the note instead of keeping the state somewhere outside it.

English · 简体中文

Why

Logseq stores a folded block as a collapsed:: true property right under it. Obsidian does not understand that line: a vault that came from Logseq shows it as plain text, and Obsidian's own folds are forgotten as soon as the note is closed.

This plugin reads and writes that marker. The Logseq style is the default, so notes stay compatible with Logseq. If you prefer something else, set your own marker — an HTML comment <!-- collapsed:: true -->, an Obsidian comment %% collapsed:: true %%, or any line of text you like.

What it does

Fold something in a list, close the note, come back tomorrow — it is still folded.

- Weekly meeting
    collapsed:: true
    - Data sources
    - Definitions check
- To do
    - Not folded yet

The marker sits one indent level in, right under the item it belongs to — the same place Logseq puts it. Whatever style you choose, the plugin hides it everywhere you look:

  • Live Preview and Source mode — the line is removed from the view, newline and all. It is not dimmed or squeezed; it is gone, and the cursor treats the spot as one atomic step, so you cannot land inside it while typing.
  • Reading view — the marker is stripped from the rendered note (including Dataview's inline-field rendering of collapsed:: true). A %% … %% comment is never rendered by Obsidian in the first place.

Nothing else about your note changes.

Markers

Style Written as Notes
Logseq (default) collapsed:: true Same as Logseq; notes round-trip between the two apps
HTML comment <!-- collapsed:: true --> Invisible in any Markdown renderer — GitHub, static-site generators, other editors
Obsidian comment %% collapsed:: true %% Invisible in Obsidian even without the plugin, but other renderers show it as text
Custom any single line, e.g. [folded] Written as-is under each folded item

collapsed:: lines are always recognised — bare, inside %% … %% or inside <!-- … --> — whichever style you write, so switching styles never loses existing folds. collapsed:: false (which Logseq can leave behind) is treated as unfolded and is reused when you fold that item again.

Recommended if your notes go elsewhere: the HTML comment

If your notes are also published or read outside Obsidian — a blog, a GitHub repo, a static site, another editor — pick the HTML comment style:

  • Clean everywhere. Every Markdown renderer drops HTML comments, so the published page shows no trace of your folds. A bare collapsed:: true or an Obsidian %% … %% comment would show up there as text.

  • Easy to remove for good. The markers are a fixed, unambiguous pattern, so one regex search-and-replace across the vault (with multiline mode on) deletes them all and leaves everything else untouched:

    ^[ \t]*<!--[ \t]*collapsed::[ \t]*(?:true|false)[ \t]*-->[ \t]*\r?\n
    

    Replace with nothing. Only whole marker lines match; the same text inside a sentence is left alone. For a single note, the Remove all fold markers from this note command does the same.

How it folds

The folding itself is not drawn by this plugin — it calls the same CodeMirror fold that ⌥S uses. You get Obsidian's own arrow, the … at the end of the line, the same click to unfold.

Marker and fold are kept in sync in both directions:

  • A marker in the file folds that item when the note opens, and again whenever another plugin or a sync rewrites the file and the fold gets lost. This direction only ever folds; it never unfolds something for you.
  • Fold something yourself — ⌥S, the arrow, whatever you already use — and the marker is written for you. Unfold it and the marker is removed. Typing and rewrites of the file don't count as folding.
  • Another plugin that folds on its own can wrap that in app.plugins.plugins["logseq-style-fold"].quietly(() => …), and those folds are not recorded as yours.

Why the state lives in the file

A JSON file in the plugin folder, keyed by line numbers or text hashes, falls apart on a note that keeps being rewritten: line numbers shift the moment anything is inserted above, and hashes break when the wording changes. A line written into the note travels with its own content through git, sync, export and any rewrite that keeps the block itself.

Commands

Command What it does
Fold or unfold the list item at the cursor Toggle the item the cursor is on (an item without children cannot be folded)
Fold every list item in this note Fold everything at once
Unfold every list item in this note Unfold everything
Fold only top-level list items Fold the outermost items, leaving inner levels as they are
Remove all fold markers from this note Delete every marker — back to the text as it was before the plugin
Show or hide fold markers Show marker lines as plain text, for checking what is in the file

Bind any of them to a hotkey in Settings → Hotkeys.

Settings

Setting Default What it does
Marker style Logseq Logseq collapsed:: true, HTML comment <!-- collapsed:: true -->, Obsidian comment %% collapsed:: true %%, or a custom line
Show a fold button on hover On An unfolded item shows a small collapse button at the end of its line while hovered
Show descendant count on the fold button On ⌄ 3 instead of ⌄
Fold in Reading view On Honour the markers in Reading view, with a clickable badge to unfold
Fold in Source mode Off Source mode hides the marker either way; turn this on to fold there too
Show fold markers Off Show marker lines as plain text for checking

Installing

Copy main.js, manifest.json and styles.css into <vault>/.obsidian/plugins/logseq-style-fold/, reload Obsidian, and enable Logseq Style Fold in Settings → Community plugins. Or add it through BRAT from MatsuriMW/logseq-style-fold.

Notes and limits

  • Outside Obsidian, collapsed:: true shows up as text — which is exactly what Logseq expects. Pick the HTML comment style if you want it invisible everywhere else.
  • Markers survive any tool that keeps the block they belong to. A rewrite that deletes or re-words the block itself loses its fold state.
  • Code blocks, callouts, ordered lists and checklists are handled. Lists inside tables are not folded.
  • Markers are matched by the item's own text fingerprint within its nesting level, so two identical items at the same depth in one note share a fold state.
  • The plugin only ever writes its own marker lines; nothing else in a note is modified.
HealthExcellent
ReviewSatisfactory
About
Keep list items folded the way you left them by writing a Logseq-style collapsed:: true marker directly into the note so folds persist across sessions and remain compatible with Logseq. Hide the marker from Live Preview, Source mode, and reading view so it never appears while editing or rendering.
OutliningProperties
Details
Current version
1.0.0
Last updated
16 hours ago
Created
16 hours ago
Updates
1 release
Downloads
1
Compatible with
Obsidian 1.4.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
马自立马自立matsurimw
GitHubmatsurimw
matsuri.site
  1. Community
  2. Plugins
  3. Outlining
  4. Logseq Style Fold

Related plugins

Advanced Canvas

Supercharge your canvas experience. Create presentations, flowcharts and more.

Meta Bind

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

Outliner

Work with your lists like in Workflowy or Roam Research.

Update modified date

Automatically update a frontmatter modified date field when the file is modified.

MetaEdit

Manage your metadata.

Featured Image

Automatically set a featured image property in your notes based on the first image.

Base Board

Organize notes into Kanban boards using frontmatter properties. Drag and drop cards between columns powered by Bases.

Word-Smith

The Ultimate Writing Suite - Write. Organize. Export.

Front Matter Title

Define a title in frontmatter to be displayed as the filename.

Badges

Add inline badges/callouts to notes.