shichongrui / obsidian-reveal-active-file

Obsidian plugin to reveal the active file automatically when you open a file
86 stars 10 forks source link

FR: Add option to automatically hide a note that's closed #20

Open Gewerd-Strauss opened 1 year ago

Gewerd-Strauss commented 1 year ago

Hello,

The idea behind this plugin is quite useful in theory, but it creates an additional issue:
Every time an active note is revealed, its corresponding folder tree up to the root directory is expanded - obviously.

However, I think that this makes it even harder to use the Files-pane because finding anything in it now involves scrolling and manually re-folding any and all folders previously unfolded.

Instead, I'd suggest that the plugin does the following:

  1. Whenever a note is opened - by whatever means, focus on it in the Files-pane. This expands the respective notes' folder structure down to the level of the note.
  2. (Re-)Fold all other currently unfolded folders in the Files-pane, thus keeping the file overview clean.

I hope the idea I want to put forth here is clear.

Thank you.
Sincerely,
~Gw

kazerniel commented 5 months ago

+1 vote for this, especially now that the only plugin with that feature was deleted from Github 🙁

https://web.archive.org/web/20230721020232/https://github.com/1C0D/Obsidian-Reveal-File-in-explorer

Gewerd-Strauss commented 2 months ago

A bit late, but here is a hotfix that might be useful to others, leveraging the plugins Collapse All by Nathonius and Commander by jsmorabitoo and phibr0:

  1. Create a macro with Commander: grafik

  2. Assign it to a hothey: grafik

This macro will first collapse the entire file-tree, and then expand the path to the currently focused file.

kazerniel commented 2 months ago

Thank you, it works! :)

Gewerd-Strauss commented 2 months ago

I mean it is not exactly what this FR would accomplish, but I find myself rarely having to use the file-explorer itself to open something - and for those times this is a completely suitable solution.