Chciałbym nadal używać rozmytego dopasowania z Ivy z wyjątkiem swiper.
Zmienna, która określa, który „konstruktor wyrażeń regularnych”, jak Ivy odnosi się do tych funkcji, jest używana dla której funkcji kolekcji jest ivy-re-builders-alist:
ivy-re-builders-alist is a variable defined in ‘ivy.el’.
Its value is ((t . ivy--regex-plus))
Documentation:
An alist of regex building functions for each collection function.
Each key is (in order of priority):
1. The actual collection function, e.g. ‘read-file-name-internal’.
2. The symbol passed by :caller into ‘ivy-read’.
3. ‘this-command’.
4. t.
Each value is a function that should take a string and return a
valid regex or a regex sequence (see below).
Possible choices: ‘ivy--regex’, ‘regexp-quote’,
‘ivy--regex-plus’, ‘ivy--regex-fuzzy’.
If a function returns a list, it should format like this:
’(("matching-regexp" . t) ("non-matching-regexp") ...).
The matches will be filtered in a sequence, you can mix the
regexps that should match and that should not match as you
like.
Tak więc, aby zmienić domyślny konstruktor wyrażeń regularnych z ivy--regex-plusna ivy--regex-fuzzy, ale zachowaj pierwszy swiper, możesz
(setq ivy-re-builders-alist
'((swiper . ivy--regex-plus)
(t . ivy--regex-fuzzy)))
lub bardziej programowo
(with-eval-after-load 'ivy
(push (cons #'swiper (cdr (assq t ivy-re-builders-alist)))
ivy-re-builders-alist)
(push (cons t #'ivy--regex-fuzzy) ivy-re-builders-alist))
Jest to opisane bardziej szczegółowo w (ivy) Completion Styles.
Naprawdę nie lubię [rozmytego dopasowania] (przynajmniej nie domyślnie przez cały czas)
Ivy pozwala na obracanie konstruktora wyrażeń regularnych w locie za pośrednictwem interfejsu hydry. Dość ukryte ostatnie zdanie (ivy) ivy--regex-fuzzynawiązuje do tego i pełniejszy opis można znaleźć pod (ivy) Hydra in the minibuffer, ale wygląda na to, że instrukcja jest nieco nieaktualna, biorąc pod uwagę, że minęło trochę czasu od ostatniego wydania.
Rezultatem jest to, że od 2017-07-04 Ivy pozwala na cykliczne przechodzenie między konstruktorami wyrażeń regularnych podczas ukończenia przez C-om( ivy-rotate-preferred-builders). Edycja : jak wskazano Asme Justw komentarzu , domyślne wiązanie klawiszy zostało zmienione C-oMna 06.02.2019 .