Use Case & Problem
Markdown documents utilize six heading levels (H1-H6). Currently, Obsidian lacks efficient navigation tools for long documents, making it difficult to:
• Quickly count H3 subheadings under an H2 section
• Preview nested heading content without manual scrolling
Proposed Solution
Implement intelligent keyboard shortcuts with document-aware behavior:
For H1 Headings:
- First press of Ctrl+Alt+1:
- Collapses all H1 content (independent of current state)
- With cursor on an H1 heading:
- Second press expands all content
- Viewport automatically jumps to the selected H1 line
For H2 Headings:
- First press of Ctrl+Alt+2:
- Expands all H1 headings
- Collapses all H2 content
- With cursor on an H2 heading:
- Second press expands all content
- Viewport centers on the chosen H2 line
Consistent Behavior:
- Extends through Ctrl+Alt+3 to Ctrl+Alt+6 (H3-H6)
- Maintains context by tracking cursor position
- Smart viewport adjustments prevent disorientation
Key Innovations:
• Two-phase operation: collapse overview → precise expansion
• Position-aware viewport handling
• Complete hierarchy support (H1-H6)
• Muscle-memory friendly shortcuts
This article has been translated and polished by AI