commit 934b46652d9cee70f42e14e957edbead94108043 parent b18144dc4b582d2bc59caa65d4407a4fe097e42b Author: Vincent Demeester <vincent@sbr.pm> Date: Thu, 16 Nov 2023 18:55:16 +0100 tools/emacs: configure more completion… - some default configuration - orderless setup Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | tools/emacs/config/config-completion.el | | | 32 | ++++++++++++++++++++++++++++++++ |
1 file changed, 32 insertions(+), 0 deletions(-)
diff --git a/tools/emacs/config/config-completion.el b/tools/emacs/config/config-completion.el @@ -77,6 +77,21 @@ (use-package embark-consult :unless noninteractive) +(use-package emacs + :unless noninteractive + :custom + (completion-cycle-threshold 2) + (completion-ignore-case t) + (completion-show-inline-help nil) + (completions-detailed t) + (enable-recursive-minibuffers t) + (read-buffer-completion-ignore-case t) + (read-file-name-completion-ignore-case t) + (resize-mini-windows t) + :config + (minibuffer-depth-indicate-mode 1) + (minibuffer-electric-default-mode 1)) + (use-package mct :unless noninteractive :custom @@ -115,5 +130,22 @@ Useful for prompts such as `eval-expression' and `shell-command'." (add-hook 'minibuffer-setup-hook #'contrib/corfu-enable-always-in-minibuffer 1)) +(use-package orderless + :unless noninteractive + :config + ;; We make the SPC key insert a literal space and the same for the + ;; question mark. Spaces are used to delimit orderless groups, while + ;; the quedtion mark is a valid regexp character. + (let ((map minibuffer-local-completion-map)) + (define-key map (kbd "SPC") nil) + (define-key map (kbd "?") nil)) + + ;; Because SPC works for Orderless and is trivial to activate, I like to + ;; put `orderless' at the end of my `completion-styles'. Like this: + (setq completion-styles + '(basic substring initials flex partial-completion orderless)) + (setq completion-category-overrides + '((file (styles . (basic partial-completion orderless)))))) + (provide 'config-completion) ;;; config-completion.el ends here