From 52529bf8dcc2826c9ec7edda44fd00dcff7ce8ac Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 5 Apr 2021 21:54:57 +0100 Subject: consolidating vertico setup --- completion.org | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/completion.org b/completion.org index 61798bc..b367d96 100644 --- a/completion.org +++ b/completion.org @@ -78,29 +78,30 @@ #+end_src * completion styles - #+begin_src emacs-lisp :load no + #+begin_src emacs-lisp (use-package orderless :ensure t - :custom ((completion--styles '(partial-completion emacs22 initials)) - (completion-category-defaults nil) - ;; (completion-category-overrides - ;; '((file (styles . (partial-completion))))) - (orderless-component-separator "[ -/]+") - (orderless-matching-styles - '(orderless-literal orderless-regexp orderless-initialism))) - :bind - ((:map minibuffer-local-completion-map ("SPC" . self-insert-command)))) + :init + (setq completion--styles '(partial-completion emacs22 initials) + completion-category-defaults nil + ;; (completion-category-overrides + ;; '((file (styles . (partial-completion))))) + orderless-component-separator "[ -/]+" + orderless-matching-styles + '(orderless-literal orderless-regexp orderless-initialism)) + + (defun jao--be-orderless (&rest _any) + (setq-local completion-styles '(orderless))) + + (add-hook 'minibuffer-setup-hook #'jao--be-orderless)) #+end_src * vertico #+begin_src emacs-lisp (jao-load-path "vertico") (use-package vertico - :init (setq vertico-count 20) - :config - (defun jao-vertico--orderless (&rest _) - (setq-local completion-styles '(orderless))) - (advice-add 'vertico--setup :before #'jao-minicomp--orderless)) - (vertico-mode) + :init + (setq vertico-count 20) + (vertico-mode)) #+end_src * marginalia #+begin_src emacs-lisp -- cgit v1.2.3