Hello there,
First of all, let me thank you for making, sharing and maintaining this wonderful piece of software! VIFM has made my life so much easier and faster ... thank you.
Thanks for the gratitude! However, Ken Steen is the one who should be credited with making and sharing it, I took over about a decade ago.
Secondly, my apologies for posting this question here, as it is really quite an irrelevant one.
I think it's a relevant question. You're trying to integrate your scripts with Vifm.
his/her(?)
his
Is it possible for an external script (but called from within vifm) to echo to the vifm build-in command line?
Yes, and in this case multiple ways are available.
In general you can use client-server interaction to pass :echo
commands to Vifm's instance. For example, do let $VIFM_SERVER = v:servername
in vifmrc
and echo using vifm --server-name "$VIFM_SERVER" --remote +'echo "msg"'
in scripts.
However, this will require escaping of messages and changing of the scripts which can be avoided.
Given that your scripts already print output and you run them in background, you can abuse Vim's mechanism of reporting errors from background applications. Basically do
nnoremap <key> :/path/to/helper/script %macro 2>&1 &<CR>
To redirect output to error stream and dialogs with that output will pop up when available. You can add %i
to ignore the output (or press Ctrl+C to silence an annoying process) and check the status in :jobs
(press e to see all previous messages from that process). If you need to read the output, then don't ignore it, because when the process is done it's output is discarded.