;;; -*- lexical-binding: t; -*- (use-package "orderless" 'orderless (setq completion-styles '(substring orderless partial-completion)) (setq completion-category-defaults nil) (setq completion-flex-nospace nil) (setq completion-pcm-complete-word-inserts-delimiters t) (setq completion-show-help nil) (setq completion-ignore-case t) (setq read-file-name-completion-ignore-case t) (setq read-buffer-completion-ignore-case t) (setq resize-mini-windows t) (setq orderless-component-separator " +" orderless-matching-styles '(orderless-prefixes orderless-literal orderless-regexp orderless-strict-leading-initialism) orderless-style-dispatchers '(equal-means-literal-dispatcher comma-means-initial-dispatcher)) ;; unbind space in the minibuffer (define-key minibuffer-local-completion-map (vector 32) nil) ;;; dispatchers ;;;###autoload (defun equal-means-literal-dispatcher (pattern _index _total) "If a pattern begins with an equal sign, then we use literals." (cond ((= (aref pattern 0) ?=) (cons 'orderless-literal (substring pattern 1))))) ;;;###autoload (defun comma-means-initial-dispatcher (pattern _index _total) "If a pattern begins with a comma, then we use initials to match." (cond ((= (aref pattern 0) ?,) (cons 'orderless-strict-leading-initialism (substring pattern 1))))))