Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

How can I create a command to copy the selected file/folder in the same director that asks for the new name?

I can do yyp, but then it shows a menu that I can select r to rename. But, it would be nice to avoid the menu.

Thank you

1 Answer

+1 vote
by
selected by
 
Best answer
by

:clone chooses a name automatically. If I use :clone?, it will open up an editor and asks for a new name. I am trying to do this entirely inside vifm so that when you trigger the command, it asks you for a new name (just like when you press shift+i that shows the current name in the command-line and you can edit it.) and then creates a new file in the same directory with the new given name.

I can write a simple bash script, but not sure how to ask for user input in vifm and show the current name there.

by

Have you opened the link to its documentation? You can specify new name, like in :clone new-name. Or you want a name prompt for some reason?

by

Yes, I did look into the documentation.
Yes, I would like to have a name prompt just like rename using capital i. Is this possible?

by

No prompt for that, the closest thing would be a mapping like:

nnoremap X :clone<space>
If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...