Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

I'm trying to yank current selected filenames:

vnoremap yf :!echo -n %f | xclip -selection clipboard %i<cr>:echo "filenames yanked to clipboard"<cr>

But when the expansion of %f macro happens, it uses a single space as a separator. I want to change that separator. I tried using --delimiter option but it didn't work.

I know I could replace the space with a \n using sed, but what if the filenames themselves have a space?

I couldnt find anything about this on the manual.

1 Answer

0 votes
by

That separator is not configurable, but you can use printf for formatting (tail is to avoid extra empty line):

vnoremap yf :!printf "\n%%s" %f:p | tail -c+2 | xclip -selection clipboard %i<cr>:echo "filenames yanked to clipboard"<cr>
...