Copy link to search results button

For now we can link notes together using [[ ]], use the search panel and star the most frequently used searches. We can also embed the whole search list as a query into a note (which is often a big list). What is in my opinion missing is the ability to create a simple link to a specific search (not the whole list of results, but only the link) that similar to the normal note links would take us to the specific search, just by clicking on it.

Current workaround (optional)

The current workaround is to use search lists created in the starred pane. Use the core plugin workspaces to save the most used searches or embed the whole list of results using ‘’'query.

But there is the inconvenience of having to remember that you have saved the search in a different pane and sometimes missing the context. Or accepting to have long notes with lot of search results.

EDIT: It turns out it can be done already. But a simple button to copy the link to search results like suggested below, would be a great option to have.

2 Likes

You can do this right now with Obsidian URIs:

[search](obsidian://search?vault=NAME_OF_VAULT_FOLDER&query=SEARCH_QUERY)

5 Likes

What @dsteinbock said, but it would be an improvement if there were a button to make and copy the link (like the “Copy search results” button).

2 Likes

That’s a great idea @CawlinTeffid , especially since it’s a complicated task to compose a non-trivial search query as a valid URI.

@Vulpes would you like to modify your feature request to be a button or other simple way to generate a search query URI on demand?

1 Like

Didn’t know that it can be already done in Obsidian, thanks :slight_smile: Yes I will modify this feature request.

I’d really like this, and would use it instead of saving searches in the Starred list because:

  • I could add link text to make them easier to understand at a glance.
  • I could save them in various places instead of a single list.
  • Using a button on the Search tab would be more intuitive than switching to the Starred tab to use a button for a search I can’t see.

While we’re waiting for this feature — I found the idea an interesting learning experience and built my first plugin.

It’s currently in review; fingers crossed. :slight_smile:

2 Likes

Update: if you want to check the plugin while it’s in official review, it’s available via BRAT. The adress is czottmann/obsidian-copy-search-url.

And here’s the showcase GIF. :smile:

Showcase GIF: both editor and search view are open, a search for "code" is done, then a mouse click on the new "Copy Obsidian search URL" is done, the result is manually pasted in the editor, then another search is done for "note", the button is clicked, and the result is pasted into the editor as well, show a different URL

3 Likes

This is exactly what I need. Thank You! :grin: