Minibuffer completion - an update

Published 2024-09-05

tag(s): #emacs #programming

A few days ago I posted about using default minibuffer completion in Emacs.

My hypothesis was that rather than being annoyed at the extra typing, I could adjust the way I interact with Emacs to "think & recall" before invoking the command to switch buffer, open a file, etc.

I can report that this has been quite successful, and produced the change I expected. I am now more aware not only of the naming conventions of things at work, but even for my own packages and custom code, I am revisiting the naming of some commands to make it more consistent.

Instead of TAB-ing my way around completion (or more accurately, C-i...ing?), which is why I used to do, I now type sometimes complete commands or filenames, then complete for the full path or variants of names.

This is my current minibuffer setup:

 
(use-package minibuffer
  :demand t
  :custom
  (completions-format 'one-column)
  (completions-max-height 20)
  (completion-styles '(flex))
  (read-buffer-completion-ignore-case t)
  (read-file-name-completion-ignore-case t)
  (completion-ignore-case t)
  (completions-detailed t)
  (completion-auto-help 'visible)
  (completion-auto-select 'second-tab)
  :bind
  (:map minibuffer-mode-map
        ("C-n" . minibuffer-next-completion)
        ("C-p" . minibuffer-previous-completion))
  (:map completion-in-region-mode-map
        ("C-n" . minibuffer-next-completion)
        ("C-p" . minibuffer-previous-completion))
  (:map hoagie-keymap
        ("" . execute-extended-command)))
       
There's a variant of completion-style that I want to test, which is (completion-styles '(substring partial-completion flex)) instead of just flex.

I really like this change. I don't discard going back to fido, icomplete, or something else in the future, but right now this just feel right. 😎


Back to top

Back to homepage