Many file operations (such as copy-file, delete-file or even find-file) provide the current file as default value to completing-read, when called interactively. So copying the current file should only be a M-x copy-fileRETM-nRETnew-fileRET away.
Unfortunately, M-n inserts the whole absolute file name in the minibuffer, which ivy can't handle. (It inserts /current-directory/absolute/path/of/file).
An option would be to detect if the history entry is an absolute path and in that case, replace the whole minibuffer content instead of only the part after the last slash.
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out. Please test this and give feedback. I think it looks OK, I didn't have an Ido behavior for a reference, since there's only ido-find-file and not ido-copy-file.
* ivy.el (ivy-read): When completing file names, put the whole file name
on history, not just the partial input that lead to that name.
This is important in order for `ivy--cd-maybe' to work.
Re #152
Many file operations (such as
copy-file
,delete-file
or evenfind-file
) provide the current file as default value to completing-read, when called interactively. So copying the current file should only be aM-x copy-file
RET M-n RETnew-file
RET away.Unfortunately, M-n inserts the whole absolute file name in the minibuffer, which ivy can't handle. (It inserts
/current-directory/absolute/path/of/file
).An option would be to detect if the history entry is an absolute path and in that case, replace the whole minibuffer content instead of only the part after the last slash.
The text was updated successfully, but these errors were encountered: