branch: master
commit bb953c60d68952c6c345967d55eed94791cf46cd
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-restrict-to-matches): Add and bind to "S-SPC"
---
ivy.el | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/ivy.el b/ivy.el
index f64782c..f322b64 100644
--- a/ivy.el
+++ b/ivy.el
@@ -125,6 +125,7 @@ Only \"./\" and \"../\" apply here. They appear in reverse
order."
(define-key map (kbd "M-i") 'ivy-insert-current)
(define-key map (kbd "C-o") 'hydra-ivy/body)
(define-key map (kbd "C-k") 'ivy-kill-line)
+ (define-key map (kbd "S-SPC") 'ivy-restrict-to-matches)
map)
"Keymap used in the minibuffer.")
(autoload 'hydra-ivy/body "ivy-hydra" "" t)
@@ -1483,6 +1484,13 @@ The selected history element will be inserted into the
minibufer."
(insert (substring-no-properties x))
(ivy--cd-maybe)))))
+(defun ivy-restrict-to-matches ()
+ "Restrict candidates to current matches and erase input."
+ (interactive)
+ (delete-minibuffer-contents)
+ (setq ivy--all-candidates
+ (ivy--filter ivy-text ivy--all-candidates)))
+
(provide 'ivy)
;;; ivy.el ends here