feat(vertico): add char-fold style dispatcher

affixing with % uses char-fold-to-regexp on the input
This commit is contained in:
Itai Y. Efrat 2021-08-10 17:51:00 +03:00
parent 26014435b2
commit c0fd2c37cd
2 changed files with 10 additions and 6 deletions

View file

@ -228,12 +228,13 @@ pressing space and entering another input. In essence, when trying to match
Doom has some builtin [[https://github.com/oantolin/orderless#style-dispatchers][style dispatchers]] for more finegrained filtering, which Doom has some builtin [[https://github.com/oantolin/orderless#style-dispatchers][style dispatchers]] for more finegrained filtering, which
you can use to further specify each space separated input in the following ways: you can use to further specify each space separated input in the following ways:
| Input | Description | | Input | Description |
|------------------+--------------------------------------------| |------------------+----------------------------------------------|
| =!foo= | match without literal input =foo= | | =!foo= | match without literal input =foo= |
| =`bar= or =bar`= | match input =bar= as an initialism | | =%foo= or =foo%= | perform ~char-fold-to-regexp~ on input =foo= |
| ==baz= or =baz== | match only with literal input =baz= | | =`foo= or =foo`= | match input =foo= as an initialism |
| =~qux= or =qux~= | match input =qux= with fuzzy/flex matching | | ==foo= or =foo== | match only with literal input =foo= |
| =~foo= or =foo~= | match input =foo= with fuzzy/flex matching |
* Configuration * Configuration
If you want to further configure this module, here are some good places to start: If you want to further configure this module, here are some good places to start:

View file

@ -41,6 +41,9 @@ overrides `completion-styles' during company completion sessions.")
((string= "!" pattern) `(orderless-literal . "")) ((string= "!" pattern) `(orderless-literal . ""))
;; Without literal ;; Without literal
((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1))) ((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1)))
;; Character folding
((string-prefix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 1)))
((string-suffix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 0 -1)))
;; Initialism matching ;; Initialism matching
((string-prefix-p "`" pattern) `(orderless-initialism . ,(substring pattern 1))) ((string-prefix-p "`" pattern) `(orderless-initialism . ,(substring pattern 1)))
((string-suffix-p "`" pattern) `(orderless-initialism . ,(substring pattern 0 -1))) ((string-suffix-p "`" pattern) `(orderless-initialism . ,(substring pattern 0 -1)))