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


In this page we see the following:

" yank path to current file to Windows clipboard with forward slashes
nnoremap yf :!echo %"c:gs!\!/! %i | clip<cr>

However, with this in my configuration file, if I navigate to a file, say "C:/temp/myfile.txt", and press "yf", my clipboard will contain:


including the quotation marks. Ideally, I think the clipboard should contain:


How we would go about achieving this? Any help would be appreciated.

Best regards.

1 Answer

0 votes


try this (added :p):

nnoremap yf :!echo %"c:p:gs!\!/! %i | clip<cr>

Thank you very much, that did the job.

One more thing: any chance the quotation marks can be removed as well? My clipboard contains:


You can try dropping " to get

nnoremap yf :!echo %c:p:gs!\!/! %i | clip<cr>

but I'm not sure how well it would work with paths containing spaces. Those quotation marks are there to do the escaping, but echo doesn't handle its arguments properly.

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.