[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4d66758 47/90: Allow to toggle matching mode with "C-o m"
From: |
Oleh Krehel |
Subject: |
[elpa] master 4d66758 47/90: Allow to toggle matching mode with "C-o m" |
Date: |
Tue, 30 Jun 2015 07:28:29 +0000 |
branch: master
commit 4d6675879652590c8a6f4c89362840f66c537374
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow to toggle matching mode with "C-o m"
* ivy.el (ivy-toggle-fuzzy): New command.
* ivy-hydra.el (hydra-ivy): Bind `ivy-toggle-fuzzy' to "m".
Fixes #142.
---
ivy-hydra.el | 7 +++++--
ivy.el | 8 ++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/ivy-hydra.el b/ivy-hydra.el
index 1efab41..8cfb134 100644
--- a/ivy-hydra.el
+++ b/ivy-hydra.el
@@ -42,13 +42,15 @@
(byte-compile-file (buffer-file-name) t)))
(error "Please install `hydra' and recompile/reinstall
`ivy-hydra'")))))
+
+
(defhydra hydra-ivy (:hint nil
:color pink)
"
^^^^^^ ^Yes^ ^No^ ^Maybe^
^^^^^^^^^^^^^^---------------------------------------
^ ^ _k_ ^ ^ _f_ollow _i_nsert _c_: calling %s(if ivy-calling \"on\"
\"off\")
-_h_ ^✜^ _l_ _d_one _o_ops
+_h_ ^✜^ _l_ _d_one _o_ops _m_: matcher %s(if (eq ivy--regex-function
'ivy--regex-fuzzy) \"fuzzy\" \"ivy\")
^ ^ _j_ ^ ^
"
;; arrows
@@ -61,7 +63,8 @@ _h_ ^✜^ _l_ _d_one _o_ops
("i" nil)
("f" ivy-alt-done :exit nil)
("d" ivy-done :exit t)
- ("c" ivy-toggle-calling))
+ ("c" ivy-toggle-calling)
+ ("m" ivy-toggle-fuzzy))
(provide 'ivy-hydra)
diff --git a/ivy.el b/ivy.el
index 75953bd..aaa7e11 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1366,6 +1366,14 @@ Don't finish completion."
(delete-minibuffer-contents)
(insert ivy--current))
+(defun ivy-toggle-fuzzy ()
+ "Toggle the re builder between `ivy--regex-fuzzy' and `ivy--regex-plus'."
+ (interactive)
+ (setq ivy--old-re nil)
+ (if (eq ivy--regex-function 'ivy--regex-fuzzy)
+ (setq ivy--regex-function 'ivy--regex-plus)
+ (setq ivy--regex-function 'ivy--regex-fuzzy)))
+
(provide 'ivy)
;;; ivy.el ends here
- [elpa] master 8c3bf21 36/90: ivy-toggle-calling: Toggle calling "RET" action for current candidate, (continued)
- [elpa] master 8c3bf21 36/90: ivy-toggle-calling: Toggle calling "RET" action for current candidate, Oleh Krehel, 2015/06/30
- [elpa] master 39eb7ed 38/90: counsel.el (counsel-M-x): Call smex-initialize, Oleh Krehel, 2015/06/30
- [elpa] master 109e5b0 37/90: Bind "C-o" to hydra-ivy/body, Oleh Krehel, 2015/06/30
- [elpa] master 7dea8b7 39/90: ivy.el (hydra-ivy/body): Autoload, Oleh Krehel, 2015/06/30
- [elpa] master 9ceb7ee 42/90: Fix yank/undo bug, Oleh Krehel, 2015/06/30
- [elpa] master d8172a0 40/90: ivy.el (ivy--regex-fuzzy): Improve for "^" and "$", Oleh Krehel, 2015/06/30
- [elpa] master 02cedb7 43/90: ivy.el (ivy-insert-current): Add and bind to "M-i", Oleh Krehel, 2015/06/30
- [elpa] master 1a5b259 44/90: Fix the minibuffer being too small with enough candidates, Oleh Krehel, 2015/06/30
- [elpa] master e334a75 45/90: ivy.el (ivy-initial-inputs-alist): Add man and woman, Oleh Krehel, 2015/06/30
- [elpa] master ae05765 41/90: Allow to customize the initial input for all commands, Oleh Krehel, 2015/06/30
- [elpa] master 4d66758 47/90: Allow to toggle matching mode with "C-o m",
Oleh Krehel <=
- [elpa] master 16fefbc 48/90: ivy-hydra.el (hydra-ivy): Add "C-j" and "C-m" exit points, Oleh Krehel, 2015/06/30
- [elpa] master 7945ab0 49/90: counsel.el (counsel-M-x): Call smex-rank, Oleh Krehel, 2015/06/30
- [elpa] master 76897c0 46/90: ivy.el (ivy-sort-functions-alist): Work for commands as well, Oleh Krehel, 2015/06/30
- [elpa] master 61bb9e0 50/90: Require TRAMP in time, Oleh Krehel, 2015/06/30
- [elpa] master 9df660c 51/90: swiper.el (swiper-query-replace): Don't miss the first, Oleh Krehel, 2015/06/30
- [elpa] master d47dd9b 52/90: ivy-hydra.el: Improve for hydra not installed, Oleh Krehel, 2015/06/30
- [elpa] master 265f47d 53/90: Swiper should not deactivate-mark, Oleh Krehel, 2015/06/30
- [elpa] master 4cdb80c 54/90: ivy-hydra.el (defhydra): Wrap in eval-when-compile, Oleh Krehel, 2015/06/30
- [elpa] master 1dbdcdc 55/90: counsel.el (counsel-M-x): Fixup, Oleh Krehel, 2015/06/30
- [elpa] master bcc5f45 56/90: counsel.el (counsel-M-x): Fixup smex interaction, Oleh Krehel, 2015/06/30