When renaming a note preserve link text as a display text

I noticed that when I’m writing notes for some terms I just create links for the future notes and leave them as is in the text. Now when I get back to creating actual notes for those links I usually like to rename the notes and this also changes the link in the original note which is nice, but it would be nicer if it preserves the original link as a display text.

Example:

Vitamin C is required for the biosynthesis of [[collagen]].

In this example collagen is a totally new link which doesn’t have it’s actual note. Now when I finally have time to go and create the collagen note, I usually like to fix the name and do renaming. So if I rename the note to Collagen the original note will get updated to:

Vitamin C is required for the biosynthesis of [[Collagen]].

This is nice and good, but ideally I would like it to preserve the original as a display text for the link like this:

Vitamin C is required for the biosynthesis of [[Collagen|collagen]]

This way I could go crazy with renaming notes and wouldn’t need to be concerned with the lost meaning in the text which links to the note.

I know that I could write it like [[collagen|collagen]] in the first place, but it’s annoying and time consuming to write the same word twice.

From the programing perspective it shouldn’t be hard to implement this. During renaming you would only need to check if the link already has a display text and if not, keep the original as a display text and rename the link.

8 Likes

Why simply not to write “… collagen (see, [[collagen]])”? This way your text is preserved and the link can be renamed Without breaking anything. And this way developers can spend their time on more urgent items :slight_smile:

1 Like

I think this is a popular feature request. Is this similar to your request?

2 Likes

Aliasing would work, but it’s way harder to implement it. All I’m asking is to keep original note name as a display text after renaming if the link didn’t have a display text before.

With aliasing you would need a way to keep all those aliases somewhere in the note. Maybe you would need to introduce some meta configuration for notes where you could keep all the aliases, but as I see it, it’s a functionality which would need a lot of thinking and work to implement it correctly.

1 Like

Just wanted to open a feature request for this and discovered this older request.

I would like to push this request by showing a use case similar to the one described by @TheHeadline - a use case I am actually confronted with several times a day:

Use case or problem

Let’s say I have to folders in my vault:

  1. “literature” - where I store my literature notes and excerpts
  2. “notes” - where I store my personal atomic notes

The following use case is a quite typical one:

I am working on a literature note (I might have created it from zotero with mdnotes, for example, showing my highlights as quotations) and within this note there is the following quotation:

obsidian is an amazing software you can for example use to build your personal zettelkasten (Source, p. 2)

When I now review my literature note, I want to create a personal note about “zettelkasten”. Thus, I double click the term and put it in brackets: [[zettelkasten]]. When I now click on this link, obsidian will create a new note named “zettelkasten” and jump to it directly. I write some stuff in there and move the note to my “notes” folder. Obsidian updates the link automatically (which is really cool!), in the original literature note the quotation now reads like:

obsidian is an amazing software you can for example use to build your personal [[…/notes/zettelkasten]] (Source, p. 2)

This, however, is certainly not what I want it to look like. It should rather be:

obsidian is an amazing software you can for example use to build your personal [[…/notes/zettelkasten|zettelkasten]] (Source, p. 2)

Proposed solution

When moving or renaming a file, wikilinks adapt the path while keeping their alias - in this case it would mean obsidian adds the ../notes/zettelkasten| information to the link instead of replacing it.

Current workaround

  1. Option 1: After moving the new file, go back to the original file and change the wikilink manually;
  2. Option 2: Every time you create a new (not yet existing) link, change it immediately in a way that it looks like [[zettelkasten|zettelkasten]] instead of just [[zettelkasten]]. This way, whenever you move the resulting file to another folder, the appearance of the original link in edit mode would stay the same.

Option 1 is kind of annoying, option 2 is certainly less dramatic but still more time-consuming as I can’t just double-click a term in order to create a new link.

I guess the proposed solution might, from a coding perspective, be quite easy to implement!? In case this is a bigger deal, this feature request is certainly not the most important one as there are some simple workarounds for the problem.

Yet, both these workarounds are somehow time-consuming and - even more important - especially when it comes to quotations (as in my above example) and I just forget to manually adapt the original link immediately after moving or renaming a file, then in the future I don’t know anymore how the original quotation was exactly - I have to open my book or file and search for the original sentence.

1 Like

Related use case: I don’t use wiki-style links, I use regular md style: foobar. When I create a link I usually highlight the word I want to use as the caption, hit the “[ ]” button, then select a file. But if the file name I select is not the same as the caption text then the caption text is changed to match the file name. This is counterintuitive and frustrating since I’ve already selected the text I want to be the caption.