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

Hello,
I was wondering if there is a quick way to open a file using the second command in the list of Filetype associated commands from :file command?
Thank you

1 Answer

0 votes
by

Hi,

There is a form of :file which accepts prefix of a command to run. Not the same as position from the top, but the purpose is similar: to pick non-default handler. As an example, :file so opens soffice %c for a PDF file in case of the following configuration:

filextype *.pdf zathura %f %i &, apvlv %c, xpdf %c, soffice %c
by

Would it be possible to set a keybinding for this like Ctrl-Enter or Shift-Enter?

by

Enter is Ctrl+M, so you can't add Ctrl second time with regular key sequences (there are terminal-specific alternatives, which may or may not work). And Ctrl+Shift combinations are also not present.

What action do you want to bind?

by

I want enter to open pdf files with my main pdf viewer. I was hoping to use ctrl+enter or shift+enter to open the pdf files with Atril. So the command would be a simple
!atril %f %i
Atril is the second one in my :file list.

by

Maybe something like:

nnoremap g<cr> :file atril<cr>

but this will apply to all files not just to PDF.

by

Thank you.
I ended up using <leader>ot.

...