mkali21 downloadsFold and unfold code blocks in the editor with a single click.
An Obsidian plugin that lets you fold and unfold code blocks in the editor with a single click, keeping long snippets out of the way until you need them.

{fold} on the opening fence, so it persists across sessions and syncs to other devicesClick the ▼ chevron that appears to the left of any code block's opening fence. The block collapses into a one-line preview:
▶ ```python x = compute_result(data) … [python]
Click the ▶ chevron to expand it again.
The clipboard button on the right of a folded block copies the full block content to the clipboard without needing to unfold it first. The icon briefly changes to a checkmark to confirm.
| Command | Description |
|---|---|
| Toggle fold all code blocks | Folds all blocks if any are open; unfolds all if all are folded |
| Toggle fold code block at cursor | Folds or unfolds the block the cursor is currently inside |
Both commands are available from the Command Palette and can be assigned a keyboard shortcut in Settings → Hotkeys.
The {fold} marker is appended to the opening fence line:
```python {fold}
x = compute_result(data)
```
This means fold state is part of the note and syncs automatically alongside your vault content.