feat(corfu, vertico): use equal orderless config

This removes the old `&` separator for Vertico (does anyone use that
instead of just space?) in favor of escapable space and unifies
orderless config with Corfu. Also implements smart separator
insert/escape/reset on `C-SPC`
This commit is contained in:
Luigi Sartor Piucco 2023-10-29 14:31:13 -03:00
parent 3d41c07370
commit fc15f169da
No known key found for this signature in database
GPG key ID: 6FF1A01853A47A66
2 changed files with 27 additions and 66 deletions

View file

@ -98,6 +98,7 @@ orderless."
;; Flex matching
((string-prefix-p "~" pattern) `(orderless-flex . ,(substring pattern 1)))
((string-suffix-p "~" pattern) `(orderless-flex . ,(substring pattern 0 -1)))))
;; TODO: Find a way to deduplicate this code from the corfu module.
(add-to-list
'completion-styles-alist
'(+vertico-basic-remote
@ -110,7 +111,7 @@ orderless."
;; find-file etc.
completion-category-overrides '((file (styles +vertico-basic-remote orderless partial-completion)))
orderless-style-dispatchers '(+vertico-orderless-dispatch)
orderless-component-separator "[ &]")
orderless-component-separator #'orderless-escapable-split-on-space)
;; ...otherwise find-file gets different highlighting than other commands
(set-face-attribute 'completions-first-difference nil :inherit nil))