Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
In ivy mode, commands that have input as prefix of their name should be presented first #265
Using standard completion or icomplete-mode,
Would it be possible to sort the list of completions so that prefix matches of the input string come before other possibilities?
You should use a dedicated command for M-x:
(global-set-key (kbd "M-x") 'counsel-M-x)
It already comes with
Alternatively, you can rely on
(setq ivy-re-builders-alist '((t . ivy--regex-fuzzy)))
I reconsidered the customization interface because of #269. You should now use:
(setq ivy-sort-matches-functions-alist '((t . ivy--prefix-sort)))
to turn on the prefix sorting. It's more flexible, since it allows to turn on extra sorting only for some commands if you want.