The Latest in Emacs Completions

Updates

The Latest in Emacs Completions

Today we’re going to experiment with the latest advancements in Emacs completion / selection systems, including a look at improvements that are coming in Emacs 29!

Let me know if I’m missing anything! I’m not fully up to date on all the changes!

Built-in Emacs 29 Completions

Let’s start by consulting a couple of sources:

Things to try:

  • icomplete-vertical-mode
  • fido-mode / fido-vertical-mode
(defun basic-completion-style ()
  (setq completion-auto-wrap t
        completion-auto-select 'second-tab
        completion-auto-help 'always
        completion-show-help nil
        completions-format 'one-column
        completions-max-height 10))

(defun icomplete-vertical-style ()
  (setq completion-auto-wrap t
        completion-auto-help nil
        completions-max-height 15
        completion-styles '(initials flex)
        icomplete-in-buffer t
        max-mini-window-height 10)

  (icomplete-mode 1)
  (icomplete-vertical-mode 1))

(defun fido-style ()
  (setq completion-auto-wrap t
        completion-auto-help nil
        completions-max-height 15
        completion-styles '(flex)
        icomplete-in-buffer t
        max-mini-window-height 10)

  (fido-mode 1)
  (fido-vertical-mode 1))

;; Bind C-r to show minibuffer history entries
(keymap-set minibuffer-mode-map "C-r" #'minibuffer-complete-history)

Vertico 1.0 Improvements

Vertico 1.0

(vertico-mode 1)
(marginalia-mode 1)

(require 'orderless)
(setq completion-styles '(orderless basic)
      completion-category-overrides '((file (styles basic partial-completion))))

(require 'vertico-quick)
(keymap-set vertico-map "M-q" #'vertico-quick-insert)
(keymap-set vertico-map "C-q" #'vertico-quick-exit)

(global-set-key "\M-R" #'vertico-repeat)
(add-hook 'minibuffer-setup-hook #'vertico-repeat-save)

(keymap-set vertico-map "DEL" #'vertico-directory-delete-char)
(keymap-set vertico-map "M-DEL" #'vertico-directory-delete-word)

(vertico-mouse-mode 1)

(require 'vertico-posframe)
(vertico-posframe-mode 1)
Subscribe to the System Crafters Newsletter!
Stay up to date with the latest System Crafters news and updates! Read the Newsletter page for more information.
Name (optional)
Email Address