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

Stay Folded

crayonzgrimcrayonzgrim541 downloads

Keep folded sections collapsed until you explicitly expand them.

Add to Obsidian
Stay Folded screenshot
Stay Folded screenshot
  • Overview
  • Scorecard
  • Updates1

Keep folded sections collapsed until you explicitly expand them.

The problem

Fold a heading in Obsidian, put the cursor on it, and press Enter. Obsidian expands the section and starts a new line inside it:

▶ Hello              ▼ Hello
## World      →        내용 1
                       내용 2
                       |
                     ## World

The fold you set up is gone, and the new line is somewhere you did not ask for.

What this plugin does

Enter on a folded block keeps the fold and adds an empty sibling after the whole section it hides:

▶ Hello              ▶ Hello
## World      →      ## |
                     ## World

Enter on a folded heading keeps it folded

Nothing expands unless you click the fold indicator or run a fold/unfold command yourself.

Headings, bullets, tasks and numbered lists are all supported

Works for headings (# through ######), bullets (-, *, +), tasks (- [ ]) and ordered lists (1., 1)), keeping the level, indentation, marker and numbering of the block you were on.

Folding

Fold however you already do — click the fold indicator, or use Obsidian's own Toggle fold command. Stay Folded reads CodeMirror's fold state, so it respects every fold no matter what created it, and adds no fold command of its own.

What it does not do

This is not an auto-folding plugin. It never folds anything for you, stores no fold state of its own, inserts no markers, and touches no key other than Enter.

When it stays out of the way

Stay Folded declines and lets Obsidian handle Enter normally unless all of these hold:

  • a single cursor, with nothing selected
  • the cursor at the very end of its line
  • that line starts a heading or list item that is currently folded
  • a plain Enter — Shift, Ctrl/Cmd and Alt combinations are untouched

Undo is a single step: the whole edit is one CodeMirror transaction.

How it works

Obsidian folds through CodeMirror 6's own fold state, so foldedRanges(state) reports both whether a block is folded and where its section ends. Stay Folded reads that instead of parsing the document, which is why a ## inside a fenced code block or frontmatter can never trigger it, and why only the cursor's line is ever scanned.

Two details are the whole plugin. The cursor is placed past the end of the folded range, because CodeMirror drops any fold whose range contains the selection head. And the fold is re-applied in a second, change-free transaction, because Obsidian unfolds every range that touches an edit.

Install

Not in the community plugin store yet. To install manually, download main.js and manifest.json from the latest release into <vault>/.obsidian/plugins/stay-folded/, then enable Stay Folded under Settings → Community plugins.

Development

npm install
npm run dev     # watch build
npm run build   # type check + production bundle
npm run lint
npm test

License

0BSD

HealthExcellent
ReviewPassed
About
Fold a heading, put the cursor on it, press Enter — and the section springs open with your new line buried inside it. Stay Folded stops that. The fold survives. An empty sibling is created after the entire section it hides, ready to type. Works with headings (# through ######), bullets (-, *, +), tasks (- [ ]) and numbered lists (1., 1)), keeping the level, indentation, marker and numbering of the block you were on. A new task always starts unchecked. It never folds anything on its own, stores no state, and adds no commands. Only a plain Enter on a folded block is intercepted — Shift, Ctrl/Cmd and Alt combinations, text selections, and anything unfolded behave exactly as before. Undo is a single step.
EditingOutlining
Details
Current version
0.1.0
Last updated
3 months ago
Created
3 months ago
Updates
1 release
Downloads
541
Compatible with
Obsidian 1.0.0+
Platforms
Desktop, Mobile
License
0BSD
Report bugRequest featureReport plugin
Author
crayonzgrimcrayonzgrim
GitHubcrayonzgrim
  1. Community
  2. Plugins
  3. Editing
  4. Stay Folded

Related plugins

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 Tables

Improved table navigation, formatting, and manipulation.

Emoji Toolbar

Quickly search for and insert emojis into your editor.

Simplified Chinese Word Splitting

Adds Simplified Chinese word splitting support for the editor and Vim mode.

Editing Toolbar

The Editing Toolbar is modified from cMenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.

Force note view mode

Force the view mode for a note by using frontmatter: YAML block with 'obsidian_ui_mode' as key.

Underline

Add underline with shortcut.

Text Format

Format selected text upper/lower/capitalize.

Word-Smith

The Ultimate Writing Suite - Write. Organize. Export.