hadynz / obsidian-sidekick

A companion to identify hidden connections that match your tags and pages
134 stars 9 forks source link

Allow partial matches instead of exact filename matches #19

Open crazymedguy opened 2 years ago

crazymedguy commented 2 years ago

Hi, just wondering if there will be plans for 'partial matches' as opposed to direct filename matches because it would be far more useful. For example, a similar obsidian plugin https://github.com/tadashi-aikawa/obsidian-various-complements-plugin does partial matches and shows a pulldown menu with several suggestions which 'partially' match instead of having the exact name. It would be nice if there could be an option to enable this! Thank you

hadynz commented 2 years ago

Funny you ask for this. This plug-in started off doing only partial matching, and recently it got modified to do exact matching instead.

Do you mind sharing some examples of partial matching that would be useful for you? It would help me to know some real examples.

GitMurf commented 2 years ago

My thoughts would be partial matching in 2 main ways:

Lets use the example of GitHub Fork

1) things like plurals and adding "ed" / "ing" etc.

2) matching fewer words.

What I would NOT want (and probably why you changed initially from partial matches) is it I typed git in my note I would NOT want it to suggest GitHub Fork. It needs to at least match a single word in the page name and/or the main primitive of the word (plurals like item 1 above). Hopefully that makes sense.

A good example for me is for people. If I have a page for John Doe when I am typing I don't want to type out the full name so usually I will just say: I talked to John today about the thing ... so I would like John to suggest John Doe as well as any of my other john pages.

Those are my main use cases.

hadynz commented 2 years ago

Can you share a couple more examples of what you'd expect when:

hadynz commented 2 years ago

@GitMurf Both your requirements are now implemented in 1.5.0. I'd greatly appreciate it if you can give it a spin and let me know if it works as you would've expected.

crazymedguy commented 2 years ago

Seems awesome! Just got something I wanted to check... Is it possible to link as an alias?

For example, while typing "keyword" which will highlight as a match on sidekick, it shows up a link [[this is a link to the keyword match]]. I'd like it to change to [[this is a link to the keyword match|keyword]] instead of [[this is a link to the keyword match]]

hadynz commented 2 years ago

For example, while typing "keyword" which will highlight as a match on sidekick, it shows up a link [[this is a link to the keyword match]]. I'd like it to change to [[this is a link to the keyword match|keyword]] instead of [[this is a link to the keyword match]]

@crazymedguy That's a really good suggestion and should be the default behaviour of the plugin. If you don't mind, can you open a separate issue with this suggestion. Would be good to have it separate to this thread which I want to close given that it's been resolved.

GitMurf commented 2 years ago

Both your requirements are now implemented in 1.5.0. I'd greatly appreciate it if you can give it a spin and let me know if it works as you would've expected.

@hadynz sorry for the slow response... yes this is precisely what I was thinking! I would close this Issue but doesn't look like I have the ability to so go ahead and close it :) Thanks for all the hard work!