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

MacOS, iTerm2. The CLI command sc-im <filename>.xlsx opens the file for editing. Accordingly, in vifm with the file selected, :!sc-im %c (or %f) opens the file.

I have added filetype *.xlsx sc-im %f & to vifmrc. When I do :file on a *.xlsx entry I get a [present] sc-im %f &, and also a [present] open -a LibreOffice.app but I don't have LO installed.

Pressing enter when a .xlsx entry is highlighted I get Background Process Error: Device not configured

Also tried adding the path: filetype *.xlsx "/usr/local/bin/sc-im" %f &

1 Answer

+1 vote
by
selected by
 
Best answer

My Vifm opens .xlsx files with sc-im as expected. My configuration file contains the following line:

filextype {*.xls,*.xlsx,*.ods} sc-im %f

Maybe the & is causing your issue?

Which application appears first when running :file, sc-im or
LibreOffice?
Do you get the same Background Process Error: Device not configured error when you manually select sc-im from the :file menu?

by

At first your line did not work here, but the errors were not reproduced and files opened in what might be .xml (I am ignorant on that.) I reset to starting state of vifmrc, commented out the references to LibreOffice.app and added the lines:

filetype {*.xls,*xlsx,*.ods,*.sc} sc-im %f
filextype {*.xls,*.xlsx,*.ods,*.sc} sc-im %f

and it works as expected. Your suggestion did work after all. Thank you!

by

To clarify a few things for completeness:

  • [present] for open -a LibreOffice.app is caused by open being present, not LibreOffice.app
  • you (mrkitz) must have put sc-im after open -a LibreOffice.app and open -a LibreOffice.app was run
  • filextype won't work in case of OS X unless you define $DISPLAY
  • no need to repeat the same command for filetype and filextype, the former is considered in graphical environments as well
  • sc-im doesn't depend on graphical environment and thus shouldn't need filextype
by

That does clarify! Thank you xaizek.

...