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 thought add a new command :movewithdate in vifmrc, to add date at the file name while moving from a panel to another with F6

first example:

.vifmrc will become after F6 on the right panel 20240508_.vifmrc

second example:

fileBackup will become after F6 on the right panel 20240508_fileBackup

has someone any idea, thx

1 Answer

0 votes
by

Works only for a single file:

nnoremap <silent> <f6> :move <c-r>=system('date +%Y%m%d')<cr>_<c-x>c<cr>

<c-r>=system('date +%Y%m%d')<cr> is what inserts the date. _<c-x>c inserts "_" followed by file's name.

by

not working yet, but still try to change your code. I will tell you later, thank you

by

Check your version of Vifm. Expression register was added in v0.12.1.

by

Arrrrgh got the Version: 0.12

need to update, thx a lot

by

@ xaizek

just for info

if I type

vifm -v

I think have the version 0.12

but if I type

apt list --all-versions vifm

I can see that I have the version 0.12-1

The expression register should therefore work, but on my system it does not.

by

You have 0.12, not 0.12.1. 0.12-1 means "version 0.12, package version 1". Package version (a.k.a. build version) is for tracking changes in packaging within the same release of some software.

by

Works perfectly in version 13 too

copy file or directory - eg:

Germany.................to....................20241130_Germany

nnoremap <silent> <f8> :copy <c-r>=system('date +%Y%m%d')<cr>_<c-x>c<cr>

Move file or directory - eg:

Germany.................to....................20241130_Germany

nnoremap <silent> <f9> :move <c-r>=system('date +%Y%m%d')<cr>_<c-x>c<cr>

thank you xaizek

...