Zettelkasten Forum


My first Obsidian plugin, link notes using IDs (link-as-search), feedback welcome!

Hi Zettelers! I wanted to share a ZK-related plugin I made for Obsidian that was partly prompted in response to Sascha's post, "The Hidden Problem with Note Titles as Links (And How to Fix It)".

The subject of the post is a technical discussion of how to link. In the post, Sascha argues why linking notes using unique IDs (UIDs) is preferable to having note titles function as link targets. The reasons he gives support why The Archive uses link-as-search over direct links. He also shows how aliases can provide a usable workaround in applications that don't support link-as-search, like Obsidian.

At the end of the post, @Sascha said:

"If you are an Obsidian power user, you can for sure write a small plugin that changes the linking mechanics by automating some of the steps to create a link alias."

This inspired me. I've been wanting link-as-search implemented as an option in Obsidian for a long time. Users have discussed/requested this feature previously (e.g., here, here, and here), but to no avail. The best workaround seemed to be aliases, like Sascha's suggestions.

I've actually just been using search to navigate my vault. That said, it would be even easier if I could alter Obsidian's default internal linking behavior to function as link-as-search. Then, I could navigate through my notes by clicking links, saving me about two mouse clicks and 6-8 keystrokes each time.

Compared to a lot of other plugins available for Obsidian, this seemed like an absurdly simple thing to implement---if you knew how to code. As it happened, I've been teaching myself more about coding recently, and I decided I finally had enough confidence to attempt this as my first plugin.

The plugin is called Link by ID, and the GitHub repository can be found here. It does what it says on the tin, i.e., the plugin enables linking notes using unique IDs by altering Obsidian's internal linking behavior to function as link-as-search.

I built in a few additional features that make life easier when using the plugin:

  • Page preview uses the same search logic, so hovering over links made using UIDs will display correctly.
  • There is a setting to toggle whether clicking on internal links opens the search panel, providing a similar way of viewing backlinks as in The Archive.
  • There is a setting to enable CSS that removes the dimmed appearance of all unresolved links, so links made using UIDs look identical to standard links.
  • There is a setting to enable a configurable link ID autocomplete suggester that you can use to search for notes and insert UIDs as links. There are options to configure the character sequence that actives the autocompletion, as well as specify the ID delimiter (the character(s) separating the ID from the rest of the filename) and position (whether the IDs are at the start or end of filenames).

I made a related post describing the plugin in the Obsidian forums here. You can also view the README file for the repository on GitHub here.

I still have to go through the steps to submit this plugin to be reviewed as an official community plugin. This means you'll have to install the plugin manually if you want to try it out. I describe how to do this in the related post I made in the Obsidian forums.

I mainly wanted to share this here to respond to the idea posed at the end of Sascha's newsletter, which helped inspired me, as well as to have an opportunity for early feedback, especially since I know there are several developers in this community with far more experienced than I have.

This is my first time doing anything like this, so feedback and comments are very welcome. I used this sample plugin template as a starting point, and went from there. I found this overview in the docs helpful. I also relied heavily on Google and LLMs for coding advice and suggestions.

I’ve only tested this plugin on macOS in small/medium sized vaults, so I’d love to hear how it works for other setups.

I'm very excited to be sharing this, and I hope others also find it useful.

Sign In or Register to comment.