Ivy supports multiple actions for the selected candidate. You can add your own actions, but by default there is a copy action that may be exactly what you need.
With the default key bindings, you can use M-o
in the minibuffer to bring up the ivy action menu, and w
to copy the currently selected candidate.
EDIT
I see this does not quite address your use case, since the current file name is not the default candidate for find-file
when ivy is enabled. I always used to use find-alternate-file
(C-x C-v
) as a quick way to grab the current file name, and this works fine with ivy using M-o w
as noted above. (Now I just have a separate key binding to copy buffer-file-name
directly.)
find-file
to copy the current file name, and how does Ivy prevent doing that?find-file
is useful for copying file name of current buffer. On UP key default completion brings current buffer file name. Then you can select it.