diff options
author | JSDurand <mmemmew@gmail.com> | 2021-01-13 13:01:34 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2021-01-13 13:01:34 +0800 |
commit | 3666deaed5b0baf0a74f14db5872105c9e7865f9 (patch) | |
tree | 3535c3f57ed9d5b1cd4e3e81831f627840b6e81b /comb/orderless-conf.el | |
parent | 1700588e1a3cfb5fa45fb64393c68782bc35fc38 (diff) |
A temporary intermeidate step
Now I got almost every functionality that we need, including pdf,
mu4e, magit, et cetera.
Diffstat (limited to 'comb/orderless-conf.el')
-rw-r--r-- | comb/orderless-conf.el | 39 |
1 files changed, 39 insertions, 0 deletions
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)))))) |