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

Malabarba
  • 22,878
  • 6
  • 78
  • 163
aiguofer
  • 588
  • 3
  • 14
  • Any particular helm commands? Helm-M-x does give me recent commands at the top for example – stsquad Dec 11 '14 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 Dec 12 '14 at 15:26

2 Answers2

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

Tom
  • 1,190
  • 7
  • 16
  • 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 Dec 12 '14 at 15:30
  • @aiguofer Open a bug on github if you found a bug. – Tom Dec 12 '14 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

aiguofer
  • 588
  • 3
  • 14
  • 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`](https://raw.githubusercontent.com/thierryvolpiatto/psession/master/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. – Joe Corneli May 27 '15 at 19:21