Small but big QoL: When linking a pre-existing word or phrase, display the note suggestion menu

Use case or problem

When I’m reviewing (or writing) a note and I decide that I want to link a word or phrase that’s already present in the note, I want to select the word (a double-click, drag and select or hold down shift and use arrows) and tap [[ to make it a link. At that point, I also want to see the note suggestion menu, in the same way that I see it if I type the [[ before typing the word.

Proposed solution

Simply, display the note menu when a user selects a word or phrase and presses [[ and then let the user choose a note to link. Ideally if the name of the chosen note doesn’t match the selected text, then create a [[name of the chosen note|originally selected text]] link (with the alias feature just released in 0.9.16, this would be so, so good as selecting an alias word in a note would then provide me with the correct note to link to :slight_smile: )

In short, I want this to happen:
linking-video-1

When I do this:
linking-video-2

Current workaround (optional)

Selecting then deleting the word/phrase, then typing [[ and then retyping the word or phrase triggers the menu. But that’s really quite annoying, especially if I’m editing a large note. I often write/expand a note out on it’s own, and then go back through it working out which bits link it to all the other notes. This is a big part of connecting and gardening my evergreen notes.

Here’s a Keyboard Maestro workaround courtesy of @AutonomyGaps Using (and automating) Obsidian on macOS - Meta Post - #8 by AutonomyGaps

Related feature requests (optional)

Display a list of current note's outgoing unlinked mentions (candidate forward links) is the same underlying idea, but presented as a list covering a whole note rather than on demand for a text fragment as here. Build once, display in two ways, two feature requests ticked :slightly_smiling_face:

Not really a feature request, but I wrote this a little while ago Connect new notes to existing notes when existing note titles are not just single words? which is relevant.

23 Likes

YES! I’ve been meaning to write this exact feature request for weeks! Thank you for articulating it.

Linking existing words and phrases is a natural part of my workflow and this would make life so much smoother.

I think there are other UX nuances to this request that would need to be fleshed out. For instance, I’d like to see this also work when typing [[ in front of an existing word. In other words, typing [[ in front of usability should open the note suggestion menu with “usability” already the active search term.

1 Like

Just to confirm, I think you mean this situation?

word-search

But when the suggestion menu opens, it should look something like this:
image

If that’s what you mean, then I agree :100:

2 Likes

Exactly :raised_hands:t2:

2 Likes

Edited the original post, just to explicitly link to Display a list of current note's outgoing unlinked mentions as they’re convergent.

After thinking about it some more, I think your request, as written here, would require two related tweaks to the behavior of the link suggestion popup menu — in order to work smoothly in the general case. Consider expanding your feature request to include these ideas if they seem helpful. Though the first could stand on its own as a separate request.

#1. Tweak the current fuzzy search algorithm for link suggestions. To illustrate, if your feature were implemented today, your “usability” example would work one way but not the other:

  • Word to phrase: Highlight the word usability with intent to link a note on usability you wrote but can’t remember the title phrase. Type [[ and link suggestion appears for Usability is made up of three things. Select it and the word is replaced by the linked phrase.
  • Phrase to word: Highlight the phrase Usability is made up of three things with the intent to link to a note usability. Type [[ and the link suggestion popup is empty.

The problem is, current fuzzy search requires matching all the search terms. It would be better if it falls back to matching fewer terms. Then it would suggest notes that had shorter titles than the phrase being linked. Ideally it would have even fuzzier fallbacks and offer at least some related suggestions (synonyms, etc.) if the results would otherwise be empty.

This seems like it’s worth making a standalone feature request - and linking back here as related.

#2. One way to get the pipe-linking behavior you describe — where choosing a link suggestion results in [[name of the chosen note|originally selected text]]: change the behavior of typing | with the link suggestion popup open if there is already highlighted text being linked.

  • Currently: typing a pipe character | with link suggestion open replaces the existing link text with the chosen link title, adds a pipe character | and is ready for you to type the link’s display text.
  • To get your requested behavior: highlight the desired link display text, type [[ to get the link suggestion popup, arrow or mouse to the desired note, type | to get the result [[desired note|link display text]]

Just edited the original post, workaround here Using (and automating) Obsidian on macOS - Meta Post if you’re using Keyboard Maestro

1 Like

See your points. For this feature request, my real need is “word to phrase” but I agree - a separate fuzzy search general improvements suggestion would be good. I’ll see if I can find something that’s already been written, or start a meta-thread on it, because I feel there will be more than just this one thing that would be good to add.

Your #2, see the KM link I’ve added above. I’m playing currently with it and it’s very close: in short, it works exactly as intended if the note has an alias that matches your selected text (it’s inserting the alias as the link text):

If the word you’ve selected is not a alias, it works but you don’t get the link text:

1 Like

Current workaround

  • Type “some text¦”
  • Select the “text”. (One word can be selected by double click or by Ctrl+Shift+Left)
    "some text"
  • When the “text” is selected, type “[[”
    “some [[text]]”
  • Press right arrow to deselect text, placing caret at the end.
    (or left arrow to place caret before “text”)
    “some [[text¦]]”
  • Press space to show suggestions
	"some [[text ¦]]"
	        suggestion 1
	        suggestion 2

If this is too much work, then sequence of these steps can be triggered by single hotkey with help of Keyboard Maestro or AutoHotkey.

1 Like

Thanks, something very close to your suggestion is suggested here as well Using (and automating) Obsidian on macOS - Meta Post It does work around the mechanical typing issue, but doesn’t work around the matching/search component on suggesting likely link pages - up to the devs on that bit at some point :crossed_fingers:

1 Like

Did you found a solution without Keyboard Maestro / Autohotkey?

Timing! After just living without for ages, I’ve just discovered this plugin and have been experimenting with it for the last week or so: GitHub - tadashi-aikawa/obsidian-various-complements-plugin: This plugin for Obsidian enables you complete words like the auto-completion of IDE.

It’s not exactly what is talked about in this thread, but it’s very close:

  • I have files for people that start with a @, and it automatically links them for me without need to type [[ which I’ve found hugely smooths things out
  • it also pops a menu whenever you’re typing something that already has a note - useful, although sometimes annoying (whenever I type the word ‘meeting’ for example, it pops up. But it then goes away
  • and finally, most relevant to this thread there is a shortcut key/palette command for you can bind to trigger the suggestions dropdown. But I’ve found it sometimes just doesn’t operate. The triggering while typing is very robust, however.
1 Like

Yes, I already use this plugin and it is great, but unfortunately it´s not a solution to this problem.

I am structuring my transcripts and every time I want to link a word or phrase it takes 4 keystrokes to trigger the box (select word; set 2 brackets; press right arrow and press space bar). Very annoying and time consuming with long texts and many links.
I guess I have to try autohotkey to solve this.

Small update. With Autohotkey it was easier than I thought. It is not the best way, because I didn’t want to use an extra tool. Anyway, now I have a hotkey on the numpad. Here is the little script:

Numpad0::
IfWinExist, ahk_exe Obsidian.exe
{
Send,[[{Right}{Space}
}
return

Use case or problem

Better handling of auto complete page names when you select some text and press [[ double brackets to add around it. I recorded a video to demonstrate (see GIF at bottom of post). I have to currently select the word/phrase, press double open bracket [[ and then I have to either just trust that whatever I have in the text is correct or that I want to just create a new page without it searching my vault. If I want to see the suggestions modal popup to search/match current page names, I then have to delete the last character so it activates the search/suggestion box.

Proposed solution

What I would like is that the box pops up as if you had typed that whole text string you selected. If no match it will say “no match found” and you can press enter to create that new page and have cursor move outside the closing ]] (like it natively does today if you just type out [[this is a new page – PRESS ENTER – ).

Current workaround (optional)

I have to currently select the word/phrase, press double open bracket [[ and then I have to either just trust that whatever I have in the text is correct or that I want to just create a new page without it searching my vault. If I want to see the suggestions modal popup to search/match current page names, I then have to delete the last character so it activates the search/suggestion box.

Supporting Details (GIF)

Obsidian improvement on auto complete page suggestions-output

Related feature requests (optional)

11 Likes

Here is post in Discord to see further discussion: Discord

Previous feature request for this is here Small but big QoL: When linking a pre-existing word or phrase, display the note suggestion menu, which links a few related points (ie. Fuzzy search and an idea of “outgoing unlinked mentions”) as well. There is also a workaround in the thread if you’re using a keyboard macro program (I use Alfred on a Mac)

Related suggestion: Make order not matter for page reference or search autocomplete

Use case or problem

When typing double square brackets, the page suggestion dropdown appears so you can pick a page to link to. However if you select some text and press [[ to surround it in brackets (the closing ones are automatically inserted), the dropdown doesn’t appear until you make further edits to the content between the brackets. This is kind of annoying.

e.g., if the text is Obsidian and you select it, then press [[, you’re left with [[Obsidian]] but no page suggestion dropdown to link it, which matters in the event that what you’ve typed is an alias to the page.

Proposed solution

Ideally Obsidian would show the page suggestion dropdown immediately when typing [[ with some text selected and not require subsequent edits.

Current workaround (optional)

Insert and delete a character to “trick” Obsidian into showing the dropdown.