tth05 / obsidian-completr

Auto-completion plugin for the obsidian editor.
MIT License
287 stars 18 forks source link

Fuzzy matching #57

Open SourignaSimmalavong opened 1 year ago

SourignaSimmalavong commented 1 year ago

It would be a huge improvement if the user can use the main letters of a word to trigger the wanted word: e.g. "mkd" would suggest "markdown" It is much easier to think about "markdown" by start writing "mk" or "md" rather than writing "mar".

In terms of priority inside the suggestions list, here is an order of precedence, from the most important to the least important:

If this is implemented, it would make things much clearer in the interface if the matching letters are emphasized too (e.g. bold, underlined, color, ...).

Thank you for the nice plugin!

Adrakaris commented 1 year ago

It's funny that you suggested this, because I've been really wanting this lol, especially the second one (scattered letters in order)

I've gone and hacked it in myself in a fork here, but since I've literally overwritten the original behaviour I won't PR it. Use however you wish.

The regex is kinda ugly but it seems to perform fine on my system still.

Edit: The suggestions may be a little buggy though. I'd need to look into that and this was a 5 minute hack. I think it doesn't interact well with ignore case and replace.