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

Hello Vifm Support Team,

I use vifm for Windows. Yanking Folder-path & Filename works on Windows PC using the clipboard command: "clip". Problem is, is that the formatting creates trailing spaces and new line.

My question is how to change the current format for yanking Folder-paths & Filenames without the trailing spaces and new line for vifm on Windows PC using the "clip" command?

Also, as a side note with using vifm yank in Windows PC is copying to clipboard with forward slashes isn't working even when following this link. (using yp/yf which is already in vifmrc by default)

1 Answer

0 votes
by

Hi,

My question is how to change the current format for yanking Folder-paths & Filenames without the trailing spaces and new line for vifm on Windows PC using the "clip" command?

You can remove spaces from the command, for example turn this

nnoremap yp :!echo %"d %i | clip<cr>

into

nnoremap yp :!echo %"d%i| clip<cr>

The stupid echo on Windows preserves spaces.

I don't think it's possible to get rid of newline, there is no switch for echo (like -n). I think this requires some other program to do it (one-liner in any scripting language installed on your machine should do).

Also, as a side note with using vifm yank in Windows PC is copying to clipboard with forward slashes isn't working even when following this link.

Yeah, it either stopped working at some point or never worked with cmd.exe and was something I used with bash. If you double \ after :gs, it will "work" by leaving two forward slashes. Escaping on Windows is hell... and must be the reason behind this.

...