Since obsidian-collapse-all plugin is considered obsolete as its “Collapse all” / “Expand all” got incorporated into Obsidian’s core, it would be good to expose a hotkey bindings for it same as they were for the original plugin (see screenshot below).
For me personally it is one of most common hotkeys I used on a daily basis: I very often perform a following combination (all performed with keyboard hotkeys):
“Reveal active file” in order to expand left sidebar and make it show “Files”
“Collapse all”, because I realise there are many things open there and it is difficult for me to locate stuff visually
“Reveal active file” once again to make current file visible and focused in “Files”
Install obsidian-collapse-all plugin and us its shortcuts, by cost of having 2 icons in Files/Tags/etc. instead of 1 and by cost of possible lack of future maintenance (since plugin is considered obsolete).
I’m not sure if this was implemented, but a possible workaround is to have a template with this: <%* document.querySelector('[aria-label="Collapse all"]').click() %>
and just create the command/shortcut to it
In the templates folder you assign to Templater, create a file with this: <%* document.querySelector('[aria-label="Collapse all"]').click() %>
In the Templater plugin settings, there is one setting where you can create a command for a specific template, you choose the template you created in step 2
You then will see the new command in the command palette, if you go to Obsidian shortcut settings you can see there that you can assign a shortcut to any command you want.
Hi guys! Any updates on this? I also would love to see a hotkey for this feature. We already have a button to collapse all folders. Why not add a shortcut for this?
I’m just going be annoying, because I am really suffering because this is not a Hotkey option.
How do we annoy the Obsidian team exactly?
See how long and out of hand it gets? I still feel like I’m at the beginning of developing out this vault.
In addition, I still can’t figure out how to prevent it from just randomly opening folders all over the place. My only solution now is to “over-use” the command + O and search. But sometimes it just drives me crazy.
Thanks for this! There are so many people making amazing things to help us all (the body of Christ). It’s difficult to acknowledge everyone, but I take this opportunity to say thank you—it works perfectly.