darlal/obsidian-switcher-plus

[Feature Request] Insert links to blocks

RyotaUshio opened this issue · 6 comments

Hi, thank you very much for making & maintaining this fantastic plugin.

I have a feature request, which is related to #82.

Currently, Quick Switcher++ supports inserting the following two types of internal links:

  • [[filename]]
  • [[filename#heading]]

But apparently, it does not support inserting block links, i.e., [[filename#^blockID]].
Since I have a lot of callouts in my notes, it would be super cool if I could insert links to them just like I can insert links to headings via the symbol command (select file -> @ -> select a heading/block -> Cmd+I).
Unlike heading links, you will have to generate a unique block ID and insert it right after the block if it has not had one.
I appreciate it so much if you could think about this.

Again, I'm a big fan of the plugin. Especially the symbol command is great. Thank you!

darlal commented

Yep, this could be added. Thanks!

Thank you, I look forward to seeing this implemented!

darlal commented

As of release 3.3.6 Symbol suggestions for existing links to blocks [[filename#^blockId]] should work as well.

I see now that this feature request includes creating new block references where they did not exist before. I'm not sure that's something this plugin should be doing, as it would likely involve silently modifying files in the background. Right now even if Callouts (or any non-header block) have blockIds they can't be inserted like headings can. That's something that could be improved, so that if a Callout did have a existing blockId then it could be inserted.

@darlal Thank you for making a part of my request come true and for the elaboration. I appreciate it.

That's something that could be improved, so that if a Callout did have a existing blockId then it could be inserted.

That sounds awesome!

As for the problem of silently modifying files, I personally think that it would be OK if there is an agreement with the user.
For example, how about making "Allow Quick Switcher++ to insert a new block ID" setting and setting it to be turned off by default? Then, new IDs are created only if the user agrees with file modifications.

darlal commented

I think in any circumstance a feature like this would have to be explicitly enabled by the user as you described, but that's not really the issue. The thing I'm concerned about is even with user consent, the plugin would have to modify user files without user interaction (the user won't see the edits being made) and that opens a whole new class possible issues and data corruption. Right now, I'm not convinced that this plugin should be modifying user files in that way.

There are a few other plugins that provide similar functionality that you might want to checkout:

Thank you for the detailed reply; I understand your opinion.

Also, a big thank you for providing the list! It's so helpful. I appreciate it!