One can launch GUI programs, for example, gv or xpdf from vifm in background in vifm's command line:

 :!gv %f &

However, if gv is launched by pressing Enter on a file like aPSfile.ps in vifm, it blocks the vifm. Is it possible to run it in the background as well when it is launched this way? The following setup in vifmrc does not work:

FILETYPE=PS=ps,eps,epsi=gv &

My current solution is to run vifm in GNU screen. gv launched by pressing Enter will run in a new screen instead of blocking vifm. However, I'd like to save that screen as well...


The vifm documentation explicitly covers this requirement:

:filet[ype] pat1,pat2,... [{descr}]def_prog[ &],[{descr}]prog2[ &],...
Space followed by an ampersand as two last characters of a command means running of the command in the background.

I have

filetype *.pdf apvlv &

in my .vifm/vifmrc and it backgrounds any .pdf files I open, allowing me to close out of vifm and have apvlv still open.

  • seems my version of vifm, 0.4, is too old to have this build-in command. Thanks. I will update my vifm. – Jing Nov 8 '12 at 7:46

I'm adding this answer here because this question pops up for various searches for executing the application under the cursor in vifm. The original answer works for filetypes (as the op asked for).

However here's how to add a binding that will run an executable under the cursor (i.e. a gui application) in the background from vifm.

Add a key binding like this to your vifmrc file so that pressing gx will attempt to execute the entity under the cursor in the background:

nnoremap gx :!%d/%c &<cr>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.