I don’t know how long we might be waiting for a plugin to handle freelinking/forward-linking and that feature is critical to me, so I wrote a Python script to interpret forward links in text.
https://github.com/perkinsben/obs_tools/tree/master/forward_linker
What the tool does:
- Scans your Obsidian vault root folder recursively for .md files and builds a list of note titles
- Sorts the titles from longest to shortest
- Pulls the text from your clipboard
- Searches through that text for instances of the titles
- Replaces the text with the link (includes handling of differing case)
- Pushes the linked text back to the clipboard
It’s not brilliant, but it’s not stupid either. It will handle a lot of different scenarios - it won’t chop words in half, it ignores link text inside of other links, etc. It still requires a once-over to verify/clean up, but it does a good job. If you have duplicated titles in your vault (ie. Obsidian prefixed them with a folder name) you’ll only get links to the original (unqualified) page with that title.
Example
Assuming you had the following pages in your Obsidian vault:
- Psychology.md
- Science.md
- Behavior.md
And the following text in your clipboard to import:
Psychology is the Science of human behavior.
After executing the script, it would be replaced with the following:
[[Psychology]] is the [[Science]] of human [[Behavior|behavior]].
I created a shortcut on my desktop to run it. PM me if you see a bug.