There is no easy way, :filextype defines external handler and doesn't process builtin commands.
Lua handler can be used to start a command and print message. If you create $VIFM/plugins/report/init.lua:
--[[
filextype {*.pdf} #report#run firefox %c
--]]
local M = {}
local function run(info)
local view = vifm.currview()
local _, cmd = string.match(info.command, "^(%S+)%s*(.*)$")
cmd = vifm.expand(cmd)
vifm.startjob { cmd = cmd }
vifm.sb.info(string.format("Started `%s`", string.match(cmd, "%S+")))
end
local added = vifm.addhandler {
name = "run",
handler = run,
}
if not added then
vifm.sb.error(string.format("Failed to register #%s#run", vifm.plugin.name))
end
return M
Then adding
filextype {*.pdf} #report#run firefox %c
to your vifmrc should give what you expect.
You can also call back into Vifm (I used %i instead of 2>/dev/null &):
let $VIFM_SERVER_NAME = v:servername
filextype *.pdf firefox %i && vifm --server-name "$VIFM_SERVER_NAME" --remote +"echo 'opened in firefox'"
But the message doesn't remain on the screen, which might be a bug.