5

Can I somehow configure Midnight Commander to execute "open %file_name%" command every time when I press Enter? If so, how can I do it?

1
  • Well, you´ve asked and I answered - no reply is rude. If my answer fits please accept the answer below or give me more details.
    – UsersUser
    Nov 13, 2014 at 9:03

3 Answers 3

9

You could edit the extension file (Menu → Command → Edit extension file). I couldn´t test it on OSX but this should work:

regex/\.(.*)$
    Open=(open %f &)
0
3

Improvement on UsersUser's answer: Use %s instead of %f to be able to open multiple files at once. Refer to the explanation inside the mc.ext config file.

Excerpt:

%s -> "selected files", i.e. space separated list of tagged files if any or name of the current file.

Ergo:

regex/\.(.*)$
        Open=(open %s &)
1

Updating this for 2023, the regex line is now unnecessary, thus only this should be added for images and some other files (PDF for example):

Open=(open %s &)

You must log in to answer this question.

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