I’m not sure if I know good words for searching for this feature in the forum, but I tried to do a quick search.
I have some text already written, and I want to select a word and then make it a link. Instead of a simple link, I want the link to have an alias, which would be the word that I have selected.
Consider the following:
- My text: “I have 14 cats.”
- I will highlight (=select) the word cats. I want to make that word to became an alias in a link.
- Currently, I can make the word to become a link just by typing [[. In this case, the result will be: “I have 14 [[cats]].”
In this case, the word cats will become the name of the linked page, but instead of that, I want cats to become an alias: “I have 14 [[|cats]].” would be my preferred outcome.
Typing [[ works well and I’m not suggesting any changes to that. But I have two ideas that both could be used to achieve the same goal.
A) Select some text and simply type |. It will result in [[|cats]] and it will place the cursor just before the | character so that I can then continue to write the name of the page that I want to link to. This way I could smoothly supplement the link to become [[Cat|cats]].
B) Almost the same as A, but instead of typing |, I would first type [[ to get the normal link [[cats]] (with cats still highlighted) and then I would type |, which would insert the | character, place the highlighted text at the right side of the | character, and finally place the cursor to the left side of the | character.
- Select the word cats.
- Type [[. Result so far: “I have 14 [[cats]].” (cats is still highlighted)
- Hit left key to remove the highlighting.
- Type |. Result so far: “I have 14 [[|cats]].” (nothing is highlighted)
- Hit left key again to get the cursor to the left side of the | character.
- Now you can finally write the page name that you want to link to, and autocompleting works too. If you would not write | before writing the page name, you could not use autocomplete, because hitting enter or tab during autocomplete would make the alias text disappear (= replaced by the autocompleted page’s name). When you have the | character in place, you won’t loose the alias text (= this works really well in Obsidian already).
I’m sorry if my post is messy. Please ask me clarification if something is unclear, I will answer gladly. Thank you for your support!