diff options
author | jao <jao@gnu.org> | 2022-09-26 23:49:24 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-09-26 23:49:24 +0100 |
commit | 3f062f8fcf7882c4ed035cb2b4651e72e342d3c8 (patch) | |
tree | 3a4a0623d0d03aab06ab0a3ec9130c00e9334b1f /custom | |
parent | 36a04a325b0daefba223c136358c9f8f89b1651a (diff) | |
download | elibs-3f062f8fcf7882c4ed035cb2b4651e72e342d3c8.tar.gz elibs-3f062f8fcf7882c4ed035cb2b4651e72e342d3c8.tar.bz2 |
further tweaks to vertico-based completion at point
Diffstat (limited to 'custom')
-rw-r--r-- | custom/jao-custom-completion.el | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/custom/jao-custom-completion.el b/custom/jao-custom-completion.el index 3d9c543..573589d 100644 --- a/custom/jao-custom-completion.el +++ b/custom/jao-custom-completion.el @@ -1,14 +1,13 @@ ;; -*- lexical-binding: t; -*- ;;; completion styles -;;;; completion configuration (setq tab-always-indent 'complete read-extended-command-predicate #'command-completion-default-include-p completion-category-defaults nil - completion-cycle-threshold nil + completion-cycle-threshold 4 completions-detailed t completion-show-help nil - completion-show-inline-help nil + completion-show-inline-help t completion-ignore-case t completion-wrap-movement t completion-auto-select nil @@ -20,7 +19,7 @@ (symbol (styles initials substring partial-completion)) (variable (styles initials substring partial-completion)))) -;;;; crm indicator +;;; crm indicator (defun jao-completion--crm-indicator (args) "Add prompt indicator to `completing-read-multiple' filter ARGS." (cons (concat "[CRM] " (car args)) (cdr args))) @@ -31,23 +30,19 @@ ;;; orderless (use-package orderless :ensure t + :demand t :init - :config (orderless-define-completion-style orderless+initialism (orderless-matching-styles '(orderless-initialism orderless-prefixes orderless-literal orderless-regexp))) - (defun jao-orderless--set-locally () - (setq-local completion-styles '(orderless basic) - completion-category-overrides - '((file (styles partial-completion orderless)) - (command (styles orderless+initialism))) - orderless-matching-styles - '(orderless-literal orderless-regexp orderless-prefixes))) - - (add-hook 'minibuffer-setup-hook #'jao-orderless--set-locally)) + (setq orderless-matching-styles + '(orderless-literal orderless-regexp orderless-prefixes) + jao-orderless-overrides + '((file (styles partial-completion orderless)) + (command (styles orderless+initialism))))) ;;; marginalia (use-package marginalia @@ -66,7 +61,6 @@ ;;; vertico (use-package vertico :ensure t - :init (defvar jao-vertico-reverse t) @@ -74,15 +68,18 @@ vertico-cycle t vertico-resize t vertico-multiform-categories nil + vertico-multiform-commands + `((".*" + (completion-styles orderless basic) + (completion-category-overrides . ,jao-orderless-overrides))) vertico-buffer-display-action `(display-buffer-below-selected (window-height . 0.5))) (dolist (c '(completion-at-point complete-symbol indent-for-tab-command)) - (add-to-list 'vertico-multiform-commands - `(,c buffer (vertico-resize) (jao-vertico-reverse)))) + (let ((s `(,c buffer (vertico-resize) (jao-vertico-reverse)))) + (add-to-list 'vertico-multiform-commands s))) :config - (defun jao-vertico--display (fun lines) (if (not jao-vertico-reverse) (funcall fun lines) |