Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value in file name completion #152

Closed
hpdeifel opened this issue Jun 18, 2015 · 2 comments
Closed

Default value in file name completion #152

hpdeifel opened this issue Jun 18, 2015 · 2 comments

Comments

@hpdeifel
Copy link

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-file RET M-n RET new-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.

@abo-abo
Copy link
Owner

abo-abo commented Jun 18, 2015

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.

abo-abo added a commit that referenced this issue Jun 18, 2015
* 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
@hpdeifel
Copy link
Author

works great so far, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants