pvojtechovsky / obsidian-link-with-alias

Obsidian plugin for handy creation of links and alias in front matter of target document
MIT License
35 stars 1 forks source link

Link with alias

Obsidian Downloads

This plugin implements these commands

Both Create link commands assures that link display text is kept => isn't replaced by Obsidian link autocompletion.

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

Toggle link display text

As long as rename of Note has to keep the text with link to note understandable, it is good idea to keep the link display text in the link. In such case the Note is renamed but link display text stays unchanged. That is wanted behavior in many cases. But in case you have just list of Notes, where you want to see current note name, then the link display text is not helpful. The "Toggle link display text" command is a fast way how to remove unwanted display text and to keep just plain link.

Settings

You can configured whether

A) the text which is selected when command is executed is copied as link target name, so the autocompletion can immediatelly offer the similar term

B) or the link target is kept empty so you can immediatelly type in the target note name

Notes

Run command, press Enter, done

About me

I am a Software developer and architect with more then 35 years of programming experience. I am highly interested in creation and maintenance of human understandable, up to date, distributed and trustworthy knowledge.

I love lifetime, nature, people, psychology and dancing. I am exited about the Obsidian because it helps me to experiment, prototype and prepare concepts of that knowledge base.

Thank You for Your support which helps me to give more time for Obsidian plugins and that Knowledge base project I am dreaming of.

Ko-fi

BuyMeACoffee