Trust me, I complete


Not too long ago I wrote about my pleasant experience with icomplete-vertical-mode, a recent addition on Emacs master which gives a vertical spin to the good old Icomplete. But now Emacs also comes with fido-mode, which enhances icomplete-mode with ido-mode powers.

The question is: can I combine fido-mode and icomplete-vertical-mode to have the best of both worlds? Yep, it turns out I can and it is simple and easy.

(fido-vertical-mode 1)

And this is basically it. The only other thing I did was setting icomplete-matches-format to nil because I don’t have a particular need for the match count at the prompt.

Whether or not one uses fido-vertical-mode, fido-mode enables nice features such as icomplete-fido-delete-char (C-d), which deletes the current character or calls dired on the current directory, and icomplete-fido-kill (C-k), which kills the current line or, for instance, if we are completing files asks if we want to delete the selected one. Check icomplete-fido-mode-map for more details on the available key bindings.

Inspecting icomplete--fido-mode-setup reveals that fido-mode also uses the flex completion style1, but nothing forces us to stick with it or try something like Orderless instead. As always with Emacs, the power is in our hands.

One more thing. The “Trust me” in the title aims to be a pun on the word “fido”. In Italian “fido” is the form for “I” of “fidare” which means “to trust”: “Mi fido di te” becomes “I trust you” in English. “Fido” is also a famous dog in Italy that came to public attention because of his strong loyalty. Thus using fido-mode implies that my love for dogs is sincere and trustworthy.

Notes

  1. C-h o completion-styles-alist RET to know more about it. Specifically, search for flex in the Value: section of the documentation.