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.

How can I copy the contents of a file to use in applications with file-dragging functionality?

0 votes
asked Nov 21 in vifm by MDingas

For context, when I want to share a file with someone in Discord or Facebook Messenger, I need to open a GUI file manager and either drag the file or ctrl+c ctrl+v it and the application fully uploads the file. Is there any way to get a similar functionality in vifm? Meaning, the ability to copy a file's content in its entirety.

1 Answer

+1 vote
answered Nov 21 by xaizek

It's not the content that is copied. It's still just a path, but with a special metadata that says that it's a file.

You can try combining commands from this wiki page and this answer. For tests do something like:

:!echo %c:p | xclip -i -selection clipboard -t text/uri-list

If that works for you, make it into a command or a mapping.

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.
...