From 3666deaed5b0baf0a74f14db5872105c9e7865f9 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Wed, 13 Jan 2021 13:01:34 +0800 Subject: A temporary intermeidate step Now I got almost every functionality that we need, including pdf, mu4e, magit, et cetera. --- comb/orderless-conf.el | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 comb/orderless-conf.el (limited to 'comb/orderless-conf.el') diff --git a/comb/orderless-conf.el b/comb/orderless-conf.el new file mode 100644 index 0000000..8af75e4 --- /dev/null +++ b/comb/orderless-conf.el @@ -0,0 +1,39 @@ +;;; -*- lexical-binding: t; -*- + +(use-package "orderless" 'orderless + (setq completion-styles '(orderless partial-completion) + completion-category-defaults nil + completion-flex-nospace nil + completion-pcm-complete-word-inserts-delimiters t + completion-show-help nil + completion-ignore-case t + read-file-name-completion-ignore-case t + read-buffer-completion-ignore-case t + 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)))))) -- cgit v1.2.3-18-g5258