From a25e2e0c89293cf5e11b0faee2bfd1dc52720db7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 30 May 2018 11:25:41 +0200 Subject: [PATCH] completion/ivy: add +fuzzy flag As mentioned in #626 --- modules/completion/ivy/config.el | 13 +++++++++++++ modules/completion/ivy/packages.el | 3 +++ 2 files changed, 16 insertions(+) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 822434c23..13dbb6cf0 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -220,3 +220,16 @@ immediately runs it on the current candidate (ending the ivy session)." ;; posframe doesn't work well with async sources (dolist (fn '(swiper counsel-rg counsel-ag counsel-pt counsel-grep counsel-git-grep)) (map-put ivy-display-functions-alist fn nil))) + + +(def-package! flx + :when (featurep! +fuzzy) + :defer t ; is loaded by ivy + :init + (setq ivy-re-builders-alist + '((counsel-ag . ivy--regex-plus) + (counsel-rg . ivy--regex-plus) + (counsel-pt . ivy--regex-plus) + (counsel-grep-or-swiper . ivy--regex-plus) + (t . ivy--regex-fuzzy)) + ivy-initial-inputs-alist nil)) diff --git a/modules/completion/ivy/packages.el b/modules/completion/ivy/packages.el index 0d764a54d..b8b76609a 100644 --- a/modules/completion/ivy/packages.el +++ b/modules/completion/ivy/packages.el @@ -10,5 +10,8 @@ (package! ivy-rich) (package! wgrep) +(when (featurep! +fuzzy) + (package! flx)) + (when (and EMACS26+ (featurep! +childframe)) (package! ivy-posframe))