Highlight link to the current note

Use case or problem

I use numerical identifiers (date + time) as the filename for my notes. This works great for me.

However, sometimes I accidentally make a link to the current note I’m editing. This for instance happens when I pick the wrong filename from the drop-down menu.

Proposed solution

If Obsidian could highlight a link that points to its own note, we can more easily spot those errors. That, in turn, would improve the quality of our backlinks.

Perhaps Obsidian can make the link italic. Or apply a CSS class, so I can style it myself.

Possible side effects

I don’t see real negative side effects of this feature. I assume that most people don’t intentionally make a link to the same note. That would be a link that doesn’t work when clicking on it.

Excluding of course links with ^ and # in them, those might make sense. But that’s not what this feature request is about. This is about plain links (such as [[2021-02-07 101150]]) that point to themselves.

Current workaround (optional)

None that I know of.

Related feature requests (optional)

I searched the forum but didn’t find related or similar requests.

4 Likes

Bumped!

Good idea.

I would agree that most people probably do not link notes to themselves, but I have found reasons to do this. For example if you regularly have many panes open and use very long note names, it can be useful to have a link to the note as the top level item within a list that folds the note contents within. This way if you need to read the entire note name, you can just fold the note content.

That being said, I can’t imagine I would mind that it was highlighted. Perhaps I’d prefer it be underlined with a color different than a misspelling indicator.

Thanks.

Another use case for linking to the current note:

You have a note name Activity 1 containing these metadata:

task:: [[task A]]
task:: [[task B]] 
task:: [[task C]]

The order of the list implies the order of the tasks. And in note Activity 2 you have:

task:: [[task X]]
task:: [[task Y]] 
task:: [[task B]]
task:: [[task Z]]

So in task B if you use this dataview query

```dataview
list task where contains(task, [[]])
```

then you will have a list like this (all items are links to the notes):

- Activity 1
 - task A
 - task B 
 - task C
- Activity 2
 - task X
 - task Y 
 - task B
 - task Z

This is useful to see the entanglement of the tasks in the activities. Task B is depend on the complement of task A, X and Y, and is the input for C and Z. If there is a way to emphasize B in the lists, then it would be great.