Skip to content

Instantly share code, notes, and snippets.

@andiogenes
Created September 26, 2025 10:08
Show Gist options
  • Select an option

  • Save andiogenes/cb318dde8e8e49f4809f892d46da563a to your computer and use it in GitHub Desktop.

Select an option

Save andiogenes/cb318dde8e8e49f4809f892d46da563a to your computer and use it in GitHub Desktop.
Dired - Copy file to the directory of window selected by AceWindow
;; Dired - Copy file to the directory of window selected by AceWindow
(defun arx/dired-do-copy-ace-window ()
(interactive)
(when-let ((dst-dir (aw-select
"Copy file to the directory of other window"
(lambda (w)
(with-selected-window w
default-directory))))
(src-file (or (dired-get-subdir) (dired-get-filename)))
(_ (y-or-n-p (format "Copy %s to %s?" src-file dst-dir))))
(if (file-directory-p src-file)
(copy-directory src-file dst-dir)
(copy-file src-file dst-dir))))
(keymap-set dired-mode-map "V" 'arx/dired-do-copy-ace-window)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment