This solution constructs a cp
command in a shell
using helm-ls-git
to fuzzy-find the source and destination.
M-x customize-variable helm-ls-git-fuzzy-match
set to on
M-x shell
to open a shell in a new window
- open any file in
repo1
, then M-x helm-ls-git-ls
and fuzzy-find image1.png
C-u C-c C-k
(helm-kill-selection-and-quit)
to copy the file path from helm
- switch to the
shell
window, type cp
and C-y
to yank the image1.png
source file path
- open any file in
repo2
, then M-x helm-ls-git-ls
and fuzzy-find a file within the destination directory (or something close to it)
C-u C-c C-k
(helm-kill-selection-and-quit)
to copy the destination path from helm
- switch back to the
shell
buffer and C-y
to paste. Modify the destination appropriately (eg. removing filename) if the previous step returned an inexact destination.
This will result in a cp
command that you can execute to copy the file. Afterwards, kill the shell
and its buffer.
You may bind helm-ls-git-ls
to a convenient shortcut if desired (for example, (global-set-key [?\C-c ?f] (quote helm-ls-git-ls))
).