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

Would it be possible to map DD to execute Trash if the user is on OS X, and move to .trash if he is on Linux/BSD? Trash is command-line program for OS X that moves files or folders to the trash.

1 Answer

0 votes
by
selected by
 
Best answer

You mean like a builtin? This implies two level of trashing, which seems to be too much. E.g. I don't use any DE on GNU/Linux and have no means to manipulate .trash, it will just grow in size, same is true for any headless configurations.

Of course you could just map DD to something:

if system('uname') == 'Linux'
    nnoremap DD :!trash-put %f
else
    nnoremap DD :!Trash %f
endif

Though 'trashprg' option could make sense, I remember user mentioning using shred to delete files securely. With empty value by default, it could remove files normally and otherwise invoke the command appending list of files to allow using Trash, trash-put, shred or something else.

by

Just pushed it, will be in 0.8.1. Named new option deleteprg. With this option, snippet above transforms into:

if system('uname') == 'Linux'
    set deleteprg=trash-put
else
    set deleteprg=Trash
endif

It won't affect :empty, which still just removes files from internal trash, at least for now.

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.
...