How can I copy the name the selected files/folders to clipboard?
Thank you
You can copy a section from sample vifmrc. There are some other variants on the Wiki.
Yes, I have been using this:
nnoremap <silent> \yn :!echo -n %c %i | xclip -in -selection clipboard<cr>
It copies the name of the current file/folder.
I want to copy the names of all the selected files/folders. Would that be possible? Thanks
Try
noremap <silent> \yn :!echo -n %f %i | xclip -in -selection clipboard<cr>
Note that %c was changed to %f; for more information see https://vifm.info/vimdoc.shtml#vifm-macros nnoremap was changed to noremap so you can individually select the files, and select a range.
%c
%f
nnoremap
noremap
Yeah, using %f should help in this case.
nnoremap was changed to noremap so you can individually select the files, and select a range.
In other words, to make the mapping work in visual mode too.
It works, but makes a single line from all the selected names.
Oh, right, can use printf for that (head is to remove newline after the last file name):
printf
head
noremap <silent> \yn :!printf '%%s\n' %f %i | head -c -1 | xclip -in -selection clipboard<cr>
Great, Thank you