24

It seems that the order of helm results is never useful... I either have to navigate through the long list or keep typing until I've narrowed the list enough.

Is there any way to sort the results in order of usage frequency?

Edit: That is, the most commonly selected helm results should appear at the top of the list, whether it's for files, commands, variables, etc

2
  • Any particular helm commands? Helm-M-x does give me recent commands at the top for example
    – stsquad
    Commented Dec 11, 2014 at 23:34
  • Hmm I think I was just using whatever stock helm completion when I hit M-x, I've just switched to using helm-M-x and it works now. I guess I need to read a bit more about helm
    – aiguofer
    Commented Dec 12, 2014 at 15:26

2 Answers 2

13

There is an adaptive sorting option for Helm which sorts the result according to their usage frequency. According to the helm source code it can be activated with the minor mode helm-adaptive-mode:

https://github.com/emacs-helm/helm/blob/master/helm-adaptive.el

2
  • Thanks, this seems to be what I'm looking for although it doesn't seem to be working as expected (not saving history) but I'll mark it as the answer since it does answer the question.
    – aiguofer
    Commented Dec 12, 2014 at 15:30
  • @aiguofer Open a bug on github if you found a bug.
    – Tom
    Commented Dec 12, 2014 at 15:44
1

Although helm-adaptive-mode is supposed to do this as Tom pointed out, unfortunately not many helm commands use it as per: https://groups.google.com/forum/#!topic/emacs-helm/S6FXhGfDFqA

I will leave his answer as accepted since it is the closest answer possible and raised https://github.com/emacs-helm/helm/issues/751

1
  • Part of the discussion pointed to in aiguofer's answer can usefully be brought in here: "I figured out how to save variables as mentioned in the previous comment. That only addresses the issue with helm-M-x." [...] "Good, you have also external packages that do this, mine is psession.el." Since this solution and the helm-adaptive-mode have different limitations, perhaps they can be used together. Long term, perhaps additional variables should be created that can be saved in the same way. Commented May 27, 2015 at 19:21

Your Answer

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

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