Smart Fold
unlistedby Fan Shen
Smart tools for efficiently folding markdown sections.
Smart Fold for Obsidian
Smart Fold is a highly optimized and lightweight Obsidian plugin that provides advanced yet intuitive tools for efficiently folding Markdown sections. It gives you finer control over the built-in folding mechanism in Obsidian without taking over your content.
Features
Adaptive Fold/Unfold Shortcuts: You can add hotkeys to globally increase or decrease the headings' folding depth across the active document.
Specific Heading Level Toggles: Easily toggle specific heading levels from H1 to H6 individually. Hotkeys can be set for targeting specific levels directly.
Smart Fold: An intelligent command that specifically toggles folding for all headings that do not have any children (sub-headings). Excellent for cleanly summarizing documents where leaf-node contents get too long.
Auto-Fold on Open: Highly requested feature—configure the plugin to automatically apply a specific fold state whenever you open a new file. You can choose to automatically fold everything to H1, or apply the Smart Fold!
Ribbon Quick Icons: Provides quick, aesthetic custom SVG icons on the left Ribbon menu H1-H6, HS (Smart Fold), H+ (Increase Fold), and H- (Decrease Fold).
Unified Toggle Logic: Turning off a ribbon icon in the plugin's settings will automatically disable its corresponding command and hotkey. This keeps your command palette and hotkey list clean and focused only on the 9 core features you use.
Usage & Settings
- Enable the plugin under Community Plugins.
- Under Settings -> Smart Fold, you can choose which Ribbon Icons you want visible.
- You can set the Default Fold State on Open from the same panel.
- Go to Obsidian's native Settings -> Hotkeys and search for
Smart Foldto assign customized shortcuts.
Development
The project requires Node.js >= 24.11.1. You can install dependencies and build it using:
npm install
npm run build
Credits
- Inspiration: This plugin's core folding logic directly references and is inspired by the exceptional work done in obsidian-creases by Liam Cain. His project is licensed under the MIT License, and I retain the spirit of open-source sharing by also releasing this plugin under MIT.
- AI Assistance: The development, refactoring, and refinement of this plugin were assisted by Antigravity, an advanced agentic AI coding assistant developed by Google Deepmind.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.