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

Section Lens

davisondavison26 downloads

Focus on one heading section or follow the minimal heading branch at your cursor.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

An Obsidian plugin that keeps the heading context around your cursor visible.

Requires Obsidian 1.14.5 or newer, the stable version used for integration testing. Uses mobile-compatible APIs; live integration testing currently covers desktop.

Install

Download main.js and manifest.json from the latest release, place them in <vault>/.obsidian/plugins/section-lens/, reload Obsidian, and enable Section Lens in Community plugins. The plugin is not yet listed in the community directory.

Commands

  • Section Lens: Focus section — expand every heading in the cursor's top-level section and collapse the other top-level sections.
  • Section Lens: Rolling folds — expand the cursor's heading and its ancestors; collapse every other heading branch, including children of the current heading.

Run a command again to stop its mode. Running the other command switches modes. Assign shortcuts under Settings → Hotkeys → Section Lens.

Both modes follow the cursor, not scrolling. A heading's body belongs to that heading until a child or subsequent heading begins. Folded sibling headings remain visible for navigation. Manual folds remain adjustable; the mode reapplies on cursor movement or editing.

Each editor pane has its own mode. Opening another note resets that pane to off; modes do not persist across app restarts. Supports Live Preview and Source mode, not Reading view.

Heading behaviour

The heading hierarchy determines sections. A sole H1 that is the first heading is treated as the document title, so its children become top-level sections. Multiple H1 headings remain separate top-level sections. Skipped heading levels retain their natural ancestry. Both ATX (## Heading) and Setext headings are supported.

Before the first section, all sections are folded. A note with no section headings is unchanged. YAML properties, code-block contents, and headings inside lists or quotes are not treated as document sections. List, code, and other non-heading folds are preserved.

Settings

When a mode stops controls toggling off and disabling the plugin:

  • Keep folds (default).
  • Restore earlier folds — restore heading folds from when the first mode was enabled. Switching between modes retains that snapshot; positions follow edits.
  • Unfold all headings — preserve non-heading folds.

Navigating to another note leaves the outgoing note's current folds in place and resets the mode. To restore or unfold before navigating, toggle the command off first.

The status bar shows the active pane's mode. Native Obsidian folds are used, including compatibility with the Synchronise Outline Folds plugin.

Build and deploy

Requires Node.js and npm.

npm ci
npm run check
npm run deploy -- /absolute/path/to/vault
obsidian plugin:reload id=section-lens

Deployment copies only main.js and manifest.json, retaining saved settings. For a first installation, enable Section Lens under Community plugins after deploying (reload Obsidian if it has not discovered the plugin yet).

To install elsewhere, copy those two files into <vault>/.obsidian/plugins/section-lens/.

Verification

npm test verifies heading parsing and tree selection. npm run build also type-checks the source.

The live smoke test requires the plugin enabled in a running Obsidian vault. It creates temporary notes in Notes/, verifies native fold state and rendered editor content, tests both editing modes and pane isolation, and removes its notes afterward:

obsidian eval code="eval(require('fs').readFileSync('/absolute/path/to/section-lens/tests/obsidian-smoke.js','utf8'))"

The plugin uses CodeMirror's folding APIs and Obsidian's editor context field. The only untyped bridge is Obsidian's Editor.cm access, checked when a command runs.

Releases

Update manifest.json, package.json, the lockfile, and versions.json together. Run npm run check, commit, then push a tag matching the version exactly (for example 0.1.0, without v). GitHub Actions builds and publishes main.js and manifest.json as release attachments after all checks pass.

Privacy and license

Section Lens runs offline. It makes no network requests, collects no telemetry, and does not access files outside the vault. It stores only its setting through Obsidian's plugin storage and changes editor folds, not note content.

MIT, copyright Chris Davison. The bundle includes the MIT-licensed Lezer Markdown parser and its common/highlight libraries by Marijn Haverbeke and contributors. Their notices are in THIRD-PARTY-NOTICES.txt and embedded in the distributed main.js.

HealthExcellent
ReviewPassed
About
Keep the heading context around the cursor visible by expanding the current section and collapsing unrelated sections. Choose Focus to open the top-level section or Rolling Folds to open the cursor heading and its ancestors; modes follow the cursor per pane and work in Live Preview and Source.
OutliningNavigation
Details
Current version
0.1.0
Last updated
2 weeks ago
Created
2 weeks ago
Updates
1 release
Downloads
26
Compatible with
Obsidian 1.14.5+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
davisondavisonchrisdavison
GitHubchrisdavison
  1. Community
  2. Plugins
  3. Outlining
  4. Section Lens

Related plugins

Notebook Navigator

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

Homepage

Open a note, base, or workspace on startup, or set it for quick access later.

Quick Switcher++

Enhanced Quick Switcher, search open panels, and symbols.

Breadcrumbs

Visualise the hierarchy of your vault using a breadcrumb trail or matrix view.

Quick Explorer

Perform file explorer operations (and see your current file path) from the title bar, using the mouse or keyboard.

Note Toolbar

Add customizable toolbars to your notes.

Vertical Tabs

Offer an alternative view that displays open tabs vertically, allowing users to group and organize tabs for a better navigation experience.

Footnote Shortcut

Makes creating footnotes more fun!

Vault Todos

Collect all outstanding TODOs from your vault and presents them in lists Today, Scheduled, Inbox and Someday/Maybe.

Open Tab Settings

Adds options to customize how tabs are opened, including open in new tab by default, preventing duplicate tabs, and more.