4

I installed vifm through macports.

If I press enter on a file, it just opens it for editing.

How can I launch a file with it's associated program?

i.e. if I have a file highlighted, is there a key I can press so that it does the same thing as

open %c

Where %c is the name of the file that's highlighted?

2 Answers 2

3

I almost accidentally saw this question and decided to provide an answer in case you're still didn't find one in the documentation.

To open files with associated programs you need to add the following command to your ~/.vifm/vifmrc file:

filetype * open %c

Then both l and i keys will work for you as expected. See help on :filetype and :filextype in the documentation.

This doesn't work out of the box, since different systems have different open commands and the default behavior is to open all files with Vim (for example, xdg-open for Ubuntu 16.04, as opposed to the aforementioned "open", which is specific to Mac). Maybe new version will contain a set of open commands for different systems in sample vifmrc file, so it will work from the beginning.

1

Using i will open the selected file with its associated program. This is per the online documentation from the Vifm site. I am not sure how or if you can alter which application opens a file from within vi; that might have to be switched elsewhere.

3
  • Actually open /mp3/file/to/play works just fine. The problem is getting vifm to do this.
    – z-buffer
    Commented Feb 25, 2012 at 15:27
  • I misunderstood your question - sorry about that. I edited my answer to hopefully offer the correct information and possibly solution.
    – soxman
    Commented Feb 25, 2012 at 19:23
  • i doesn't do anything. I also tried it in Linux and it doesn't work there either.
    – z-buffer
    Commented Feb 26, 2012 at 1:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .