Key Combination for custom preview link

Here is what Obsidian Help said:

To make the link display different text than its real note name in Preview, use the vertical pipe (shift+|) For example: [[Another Page Title Here|Custom Link Name in Preview!]]

Is any key combination to achieve this? Maybe similar to Internal Link combination?

3 Likes

What would you expect the key combination to do? Obsidian doesn’t know what display text you want to use so I don’t understand what could be automated.

Pressing CTRL+K on a selected word it automatically insert “()”.
It would be nice on a selected word with a key combination to insert
[[ | selected word]] and to move the cursor before vertical pipe

5 Likes

Actually, a very good suggestion! Why don’t you update your original post and move it to the Features section?

2 Likes

Done!

1 Like

Thanks @mafsi. That clears it up.

1 Like

I created a quick workaround for this in AutoHotkey and wanted to share in case someone finds it useful:

custom_link_video

Send, [[{Left}{Space}{Left}|{Left}{Space}{Left}
3 Likes

put the script here.

The single line of script is right after the little .gif in my previous comment. In addition to it, you need to define what hotkey to use, for example ^k:: for ctrl + k.

It’s working! Thanks a lot!

I put it only for Obsidian

; Obsidian
#IfWinActive, ahk_exe Obsidian.exe
^k::
Send, [[{Left}{Space}{Left}|{Left}{Space}{Left}
1 Like