3

When I use helm fuzzy matching, call helm-M-x type elm I would like emacs-lisp-mode to pop up as a candidate. Instead I get

helm-M-x
helm-gid
helm-dash
helm-locate
...

I don't find this default fuzzy matching very helpful. How do you achieve more intuitive fuzzy matching?

Looking up how to change this, I found the package helm-fuzzier and it looked promising but after installing it didn't work (it seems a bit outdated).

1 Answer 1

3

I guess you would have to modify or change the helm-fuzzy rank scoring function. Per default, helm fuzzy sort will sort match candidates based on their scores as computed with helm-score-candidate-for-pattern.

Now, I don't think any sane algorithm should rank emacs-lisp-mode a better candidate match to the search term elm than the candidate helm-M-x. If you think about it, the pattern elm is continuous in helm, not so in emacs-lisp-mode.

If the pattern is not continuous, then it does make sense to choose the starting letters first. Try searching for em instead and you'll see emacs-lisp-mode as your first candidate.

The fuzzy algorithm is helpful, provided you let it be helpful on it's on way.

3
  • I don't get emacs-lisp-mode as the first candidate or even as a candidate in the visible portion of my minibuffer. I get emerge-file emacs-version emacs-init-time emacs-index-search.... I do get it as the fourth when I use ema. I respectfully disagree with your assertion that if the pattern is not contiguous, ... it does not make sense to choose the starting letter.... For me at least, I find choosing the starting letters first is a lot more useful than contiguous patterns most of the time, particularly because elisp doesn't have namespaces. Apr 23, 2018 at 19:19
  • As an example I just made up: trying to find the command helm-top. I need to type helm-t find it as per helm's default fuzzy matching. In contrast using ivy-regex-fuzzy which uses a combination of contiguous and non-contiguous searching, when I type ht, I get helm-top as the first candidate. Thank you by the way showing me the function I need to modify to achieve this behavior. Apr 23, 2018 at 19:19
  • Do you have any extra configurations set for helm? Check out Tuhdo's Helm guide and the spacemacs helm layer before digging deep into the helm source. Maybe you find some optimizations that better fit your workflow. Good luck!
    – Daniel
    Apr 23, 2018 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.