Replies: 5 comments
|
Vertico is sorting, but it only has useful history data when the current completion command uses a real minibuffer history variable and the historical entries match the current completion base. A few concrete checks:
(use-package savehist
:ensure nil
:init
(savehist-mode 1))
M-: minibuffer-history-variableVertico sorts from that variable. If it is
Vertico also lets you override sorting per category. For example, if you want directories-first file sorting without relying on history: (setq completion-category-overrides
(quote ((file (styles basic partial-completion)
(vertico-sort-function . vertico-sort-directories-first)))))So the likely answer is: your setup is basically correct, but history sorting is command/history-variable based, not a universal recentf/frequency ranking layer. First inspect If this points you in the right direction, please mark the answer as accepted so the thread is easier to find later. |
|
Thanks for the swift and detailed reply!
|
|
Thanks, that narrows it to One detail I should have made clearer: Vertico's normal default is The quick test I would try is to force the override only for (use-package vertico
:custom
(vertico-multiform-commands
'((execute-extended-command
(vertico-sort-override-function . vertico-sort-history-length-alpha))))
:init
(vertico-mode)
(vertico-multiform-mode))Then run one uncommon command through minibuffer-history-variable
extended-command-historyThe first should be |
|
Forcing the override has not worked, commands still do not rise up the
suggestion list.
I'm not sure how to inspect minibuffer-history-variable while the
minibuffer is open. If I M-X so that the vertico minibuffer appears, doing
M-: to evaluate minibuffer-history-variable closes the minibuffer.
…On Wed, 29 Jul 2026 at 08:06, Serge Yudin ***@***.***> wrote:
Thanks, that narrows it to execute-extended-command /
extended-command-history, not file completion.
One detail I should have made clearer: Vertico's normal default is
vertico-sort-history-length-alpha, and vertico-sort--history reads the
active minibuffer-history-variable, so extended-command-history is the
right history variable for M-x. However, Vertico also respects a
completion metadata display-sort-function before vertico-sort-function.
If the command/category supplies or inherits another display sort, changing
only vertico-sort-function may not visibly change M-x.
The quick test I would try is to force the override only for M-x:
(use-package vertico
:custom
(vertico-multiform-commands
'((execute-extended-command
(vertico-sort-override-function . vertico-sort-history-length-alpha))))
:init
(vertico-mode)
(vertico-multiform-mode))
Then run one uncommon command through M-x, open M-x again, and check with
the same prefix. If it moves up with vertico-sort-override-function, the
history is fine and the missing piece was another sort function taking
precedence. If it still does not move, the next thing to inspect while the
M-x minibuffer is open is:
minibuffer-history-variableextended-command-history
The first should be extended-command-history, and the command name should
appear near the front of the second.
—
Reply to this email directly, view it on GitHub
<#677?email_source=notifications&email_token=BKUDSI7WNR6OAUGPBFSCU635HGO7XA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZYGIZTIMJYUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-17823418>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BKUDSI7ISCG5RXSSKV2Z7UD5HGO7XAVCNFSNUABIKJSXA33TNF2G64TZHMZTKMZXHA3DCMRRHNCGS43DOVZXG2LPNY5TCMBVGAYDGNRXUF3AE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BKUDSI3LYUTSVGQWXGIBAQD5HGO7XA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZYGIZTIMJYUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVJTG633UMVZF62LPOM>
and Android
<https://github.com/notifications/mobile/android/BKUDSI7SS7FRS56YWCQ7JJ35HGO7XA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZYGIZTIMJYUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
The damn thing's fixed itself! Thanks so much for your help @yudin-s but I think it was a system update that fixed it 😅 |
Uh oh!
There was an error while loading. Please reload this page.
Hi! I am having trouble getting vertico to sort suggestions by history. My minimal config (elpaca/savehist/vertico):
No matter what command I type/what files I open, the sort order remains the same. I have
historyandrecentfin~/.config/emacsas expected. :/Any help appreciated☺️
All reactions