hibara91 downloadsCollapse the core Outline view of the active file at a chosen heading level.
A small Obsidian plugin that folds the core Outline view of the active note at a heading level you choose. Obsidian can collapse outline items one by one, but there is no way to say "show me H1 and H2 only" in a single step. That is what this plugin adds.
* wildcards, so a section you always want in view survives the fold.H2 to a hotkey and H4 to another.Heading levels come from Obsidian's metadata cache, not from how deeply the rows are nested, so notes that start at H2 or skip a level still collapse at the level you asked for.
| Command | What it does |
|---|---|
| Collapse outline at the configured level | Uses the level set in the plugin settings |
| Collapse outline at H1 and deeper | Only the H1 rows stay visible |
| Collapse outline at H2 and deeper | H1 and H2 stay visible, everything below is folded |
| ... through H6 | |
| Expand the whole outline | Unfolds every heading |
Collapse level - the level used by the main command, the ribbon icon and auto-collapse.
Unfold headings above the level - when on, headings above the collapse level are expanded first, so the outline always ends up showing exactly that level. Turn it off to only fold, and never unfold, what you already collapsed by hand.
Keep these headings open - a free-form list, one heading name per line. A heading whose
name is on the list is never folded, and neither are the headings it sits under, so it always
stays in view. A line has to match the whole heading, except that * stands in for any run
of characters: 3. Part* keeps every heading that starts with 3. Part, and *TODO* keeps
every heading with TODO anywhere in it. Matching ignores case, leading # marks are stripped
so you can paste a heading straight out of your note, and lines starting with // are comments.
Names that match nothing in a note are simply ignored, and a name that matches more than one
heading keeps every one of them open.
// sections I always want in view
Open questions
## TODO
3. Part*
The headings below a kept one still follow the collapse level, so keeping Chapter B open
shows its children without unfolding the whole branch.
Collapse on file open - apply the collapse level automatically when a note is opened. On by default; turn it off if you would rather collapse only by command.
Show ribbon icon - add a ribbon button for the main command.
The core Outline plugin must be enabled and its view open (sidebar or elsewhere). If no outline view is open, the commands do nothing and show a short notice.
main.js and manifest.json from the latest release.<vault>/.obsidian/plugins/outline-collapse/.npm install
npm run dev # watch build
npm run build # type-check + production bundle
MIT