diff options
-rw-r--r-- | completion.org | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/completion.org b/completion.org index f289e4b..10042f4 100644 --- a/completion.org +++ b/completion.org @@ -31,6 +31,22 @@ (command (styles initials substring partial-completion)) (symbol (styles initials substring partial-completion)) (variable (styles initials substring partial-completion)))) + + ;; (setq completions-sort #'jao-completion--sort-by-length-alpha) + (setq completions-sort #'jao-completion--sort-by-history) + + (defun jao-completion--sort-by-alpha-length (elems) + (sort elems (lambda (c1 c2) + (and (string-version-lessp c1 c2) + (< (length c1) (length c2)))))) + + (defun jao-completion--sort-by-history (elems) + (let ((hist (and (not (eq minibuffer-history-variable t)) + (symbol-value minibuffer-history-variable)))) + (if hist + (minibuffer--sort-by-position hist elems) + (jao-completion--sort-by-alpha-length elems)))) + #+end_src * orderless #+begin_src emacs-lisp @@ -77,7 +93,7 @@ ("M-<backspace>" . vertico-directory-delete-word) ("<backspace>" . vertico-directory-delete-char)))) - (vertico-mode) + ;; (vertico-mode) #+end_src * mct @@ -102,7 +118,7 @@ jao-buffer-same-mode vc-retrieve-tag))) - ;; (mct-minibuffer-mode 1) + (mct-minibuffer-mode 1) ;; (mct-region-mode 1) #+end_src |