Skip to content

Commit

Permalink
counsel.el (counsel-find-file-copy): Add and bind.
Browse files Browse the repository at this point in the history
Fixes #1955
  • Loading branch information
leungbk authored and abo-abo committed Mar 8, 2019
1 parent 4e07e6f commit 3de074a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions counsel.el
Expand Up @@ -1815,6 +1815,16 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise default to
#'yes-or-no-p)
(apply #'format fmt args)))

(defun counsel-find-file-copy (x)
"Copy file X."
(ivy-read "Copy file to: " #'read-file-name-internal
:matcher #'counsel--find-file-matcher
:action (lambda (new-name)
(require 'dired-aux)
(dired-copy-file x new-name 1))
:keymap counsel-find-file-map
:caller 'counsel-find-file-copy))

(defun counsel-find-file-delete (x)
"Delete file X."
(when (or delete-by-moving-to-trash
Expand Down Expand Up @@ -1846,6 +1856,7 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise default to
("x" counsel-find-file-extern "open externally")
("r" counsel-find-file-as-root "open as root")
("k" counsel-find-file-delete "delete")
("c" counsel-find-file-copy "copy file")
("m" counsel-find-file-move "move or rename")
("d" counsel-find-file-mkdir-action "mkdir")))

Expand Down

0 comments on commit 3de074a

Please sign in to comment.