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

Hi, my original useage is sending desktop notifications when :move is completed.
there are some characteristics of :move in this use: blocking, time consuming, builtin.

i have tried these:
the event mechanism: but i failed to find one which get emitted whenever a builtin command is completed; adding such event can hurt performance? i found no equivalent in vim.
re-define it: that's not allowed
* define a new command, say :Move, as move && startjob('notify-send') in vifmscript. what if i want to apply same logic to :delete and many others?

this usecase is rather common to me, wrapping rsync/cp/rm/... in a script to do it is good but i prefer do copying/deleting/moving jobs in vifm when they are little in size and only local disk transfering, for convenience.

do you know a better way to do it?

1 Answer

0 votes
by
selected by
 
Best answer

Hi,

As you've discovered, there is no event-like mechanism for that.

blocking, time consuming, builtin.

If you append & to the command, it will be non-blocking and appear on a job bar. I think all file operations with the exception of :alink and :rlink support running in background.

by

Glad to get your reply!
I missed the use of & here, it's more complicated than i imagined.
I'd make new commands and scripts for this.

...