Archive
Posts Tagged ‘docx’
Configure Midnight Commander to open files with custom application
December 8, 2010
7 comments
Problem
You use Midnight Commander (mc) for all your file operations. So far it’s not a problem :) However, when you hit Enter on a file, you would like to set what application mc should use for opening the given file.
For instance, you want to open an .avi file with VLC instead of X player, etc.
Solution
Steps to follow:
cd ~/.mc cp /etc/mc/mc.ext . ln -s mc.ext bindings
That is, copy the global mc.ext to your local .mc directory and put a symbolic link on it called bindings. Now you can start customizing your local mc.ext file.
Don’t forget to restart mc after editing mc.ext!
Examples:
(1) You want to open all your video files with VLC. You also want to add support for .wmv files.
# add these lines
regex/\.([wW][mM][vV])$
Include=video
# modify the include/video section
include/video
#Open=(mplayer %f >/dev/null 2>&1 &) # for mplayer
Open=(vlc %f >/dev/null 2>&1 &) # for VLC
(2) Open .docx files with OpenOffice.org.
# add these lines
regex/\.([Dd][oO][cC][xX])$
Open=(ooffice %f &)
(Thanks for the mc mailing list for their help).