Button that collapses all headings (maybe also bullets)

I realized that I need it while using the Tasks plugin and the Recurring feature there, which adds new lines and creates very long files.
I think it would be useful in various other cases with long files.

Do you know theses commands (command palette): “Fold all headings end lists”, “Fold less”, “Fold more”…?

1 Like

When already using the mouse, it can be a slight diversion to press the hotkey for Fold all headings and lists then return to using the mouse. In these cases a button could be worth having, especially if this is needed regularly. Try checking out the Commander plugin. Another option that might be worth considering is programming a hotkey for a button on your mouse. See this request as well: Added hotkeys for Fold Headings and Fold Indents

Good luck!

The idea of creating a separate button that can collapse headers (and perhaps lists) in a document sounds like a good first plugin to try to create.

I’ve been meaning to get into creating some plugins of my own so I wouldn’t mind starting a github repo and working on a simple solution. If there’s anything to keep in mind, I’d be happy to read about it.

There is already a buttons plugin, and given the command you can easily create a button in some document to trigger that command.

Give that button definition a block id, e.g. collapse, and you can do `button-collapse` in any document and display that button.

The only downside is that the button isn’t available in source mode, only in live preview and reading.

You can add any command as a button with the Commander plugin.