branch: master
commit 02cedb7a6bc7d915681bb0765b4fd1784a86dd31
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-insert-current): Add and bind to "M-i"
Use "M-i" if you want something close to the current candidate. You can
follow up with an edit and select.
Fixes #141
---
ivy.el | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/ivy.el b/ivy.el
index 4e646d0..c812466 100644
--- a/ivy.el
+++ b/ivy.el
@@ -122,6 +122,7 @@ Only \"./\" and \"../\" apply here. They appear in reverse
order."
(define-key map (kbd "C-M-p") 'ivy-previous-line-and-call)
(define-key map (kbd "M-q") 'ivy-toggle-regexp-quote)
(define-key map (kbd "M-j") 'ivy-yank-word)
+ (define-key map (kbd "M-i") 'ivy-insert-current)
(define-key map (kbd "C-o") 'hydra-ivy/body)
map)
"Keymap used in the minibuffer.")
@@ -1344,6 +1345,13 @@ BUFFER may be a string or nil."
(when amend
(insert amend))))
+(defun ivy-insert-current ()
+ "Make the current candidate into current input.
+Don't finish completion."
+ (interactive)
+ (delete-minibuffer-contents)
+ (insert ivy--current))
+
(provide 'ivy)
;;; ivy.el ends here