People more knowlegable than I have suggested that intelligent fuzzy matching and sorting for both minibuffer completion and in-buffer completion could be accomplished by implementing a completion-style
.
A style that can match according to an arbitrary predicate and can sort according to an arbitrary comparison function would be ideal.
completion-styles
is a variable defined inminibuffer.el
. Its value is(basic partial-completion emacs22)
Documentation: List of completion styles to use. The available styles are listed in
completion-styles-alist
.Note that
completion-category-overrides
may override these styles for specific categories, such as files, buffers, etc.You can customize this variable.
This variable was introduced, or its default value was changed, in version 23.1 of Emacs.
I'm would personally love to see fuzzy in-buffer completion (à la Visual Studio, Sublime Text, Vim+Neocomplete, Vim+YCM. However, after reading minibuffer.el
, I'm completely lost.
How can this be achieved?
There is a lot of interest in this problem:
- [Github] Adding fuzzy matching to
company
- [Github] Implementing a completion style for
flx
- [Emacs.SE] How can I get fuzzy code completion
- [Superuser] Is there emacs plugins to do Sublime-like completion and goto anything?
- [SO] Emacs fuzzy autocompletion
- [Emacs ML] fuzzy auto-complete via
<tab>
? - [Reddit] Auto-complete with flex/ido-like matching?
- Of course, I'm not sure if anyone wants to use this without a framework, but you absolutely could.