New plugin: Link with alias - Fast link creation including link alias

Hi everyone,

the Link with alias plugin is available since today for Obsidian community. :tada:

It can support you in process of link creation, mainly in cases when you need alias in target note with link display text which differs from Note name. It is a common case for inflectional languages with many word forms.

I developed this plugin, because I needed to create thousands of links during process of conversion of plain text to wikipedia-like notes. So it is already quite well tested :grinning:

Use cases

Make link on existing text

User selects some text and runs the command “Create link with alias”. The command creates a new link with target and display name copied from selected text and opens the link autocompletion popup and …

A) … user can just select a value from the autocompletion popup, press Enter and link and alias are created.

Run command, press Enter, done

B) … user can edit the link target then select a value from the autocompletion popup, press Enter and link and alias are created. Note that link text is kept.

Run command, edit link, select in autocompletion, press Enter, done

C) … user can enter name of new note, let cursor leave the link, then the new note is created automatically with link display text as alias.

Run command, edit link, leave the link, done

Add alias for existing link

User puts cursor into existing link and runs command “Create link with alias”. The command creates the target document, if it doesn’t exist, and adds link display text as alias into front matter of the target note

Run command in link, done

Make completely new link

User puts cursor into text and runs command “Create link with alias”. It creates link brackets and opens autocompletion popup for entering of link target name. After user types in part of the target name or alias and selects it by enter, the link is created. If there is no display text and user moves back into link and enters one, then system detects it and after cursor leaves the brackets or user closes the window, the link display text is added as alias into front matter of the target note. While this use case is supported, it is usually faster to write text without link first and then Make link on existing text.

Run command, select target, press Enter, move cursor back, write alias, leave the link, done

Notes

  • The alias is added into front matter of the target note only when it isn’t there yet
  • The aliases are sorted from longest to shortest, so the Obsidian backlinks are detected correctly
  • The link autocompletion popup is the standard one provided by Obsidian. It sometime replaces the link text automaticaly, but it isn’t wanted in this use case. The action “Create link with alias” will keep the link text exactly the same like it was before.

Run command, press Enter, done

I am looking forward to your feedback :wink:

I hope it helps you too! :purple_heart:

6 Likes

Oh wow, this is great! Definitely solves a UI inefficiency I’ve had for a long time as an avid user of aliases. Thank you so much :slight_smile:

4 Likes