Function: treemacs-copy-file
treemacs-copy-file is an autoloaded, interactive and byte-compiled
function defined in treemacs-file-management.el.
Signature
(treemacs-copy-file)
Documentation
Copy file (or directory) at point.
If the selected target is an existing directory the source file will be directly copied into this directory. If the given target instead does not exist then it will be treated as the copied file's new name, meaning the original source file will be both copied and renamed.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-file-management.el
;;;###autoload
(defun treemacs-copy-file ()
"Copy file (or directory) at point.
If the selected target is an existing directory the source file will be directly
copied into this directory. If the given target instead does not exist then it
will be treated as the copied file's new name, meaning the original source file
will be both copied and renamed."
(interactive)
(treemacs--copy-or-move
:action 'copy
:no-node-msg "There is nothing to move here."
:wrong-type-msg "Only files and directories can be copied."
:action-fn (lambda (from to)
(if (file-directory-p from)
(copy-directory from to)
(copy-file from to)))
:prompt "Copy to: "
:flat-prompt "File to copy: "
:finish-verb "Copied"))