emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master c78a306 09/54: ivy.el (ivy-kill-ring-save): Add and bind t


From: Oleh Krehel
Subject: [elpa] master c78a306 09/54: ivy.el (ivy-kill-ring-save): Add and bind to "M-w"
Date: Tue, 29 Sep 2015 14:09:49 +0000

branch: master
commit c78a30608e23afc193fbe2ab30b6f73d734c1aec
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy-kill-ring-save): Add and bind to "M-w"
    
    Fixes #197
---
 ivy.el |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ivy.el b/ivy.el
index 36b75c0..7a7b80e 100644
--- a/ivy.el
+++ b/ivy.el
@@ -139,6 +139,7 @@ Only \"./\" and \"../\" apply here. They appear in reverse 
order."
     (define-key map (kbd "M-o") 'ivy-dispatching-done)
     (define-key map (kbd "C-k") 'ivy-kill-line)
     (define-key map (kbd "S-SPC") 'ivy-restrict-to-matches)
+    (define-key map (kbd "M-w") 'ivy-kill-ring-save)
     map)
   "Keymap used in the minibuffer.")
 (autoload 'hydra-ivy/body "ivy-hydra" "" t)
@@ -1648,6 +1649,18 @@ BUFFER may be a string or nil."
     (when amend
       (insert amend))))
 
+(defun ivy-kill-ring-save ()
+  "Store the current candidates into the kill ring.
+If the region is active, forward to `kill-ring-save' instead."
+  (interactive)
+  (if (region-active-p)
+      (call-interactively 'kill-ring-save)
+    (kill-new
+     (mapconcat
+      #'identity
+      ivy--old-cands
+      "\n"))))
+
 (defun ivy-insert-current ()
   "Make the current candidate into current input.
 Don't finish completion."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]