# -*- mode: conf -*-## All lines starting with # or empty lines are thrown away.# Lines starting in the first column should have following format:## keyword/descNL, i.e. everything after keyword/ until new line is desc## keyword can be: ## shell (desc is, when starting with a dot, any extension (no wildcars), # i.e. matches all the files *desc . Example: .tar matches *.tar;# if it doesn't start with a dot, it matches only a file of that name)## regex (desc is an extended regular expression)# Please note that we are using the GNU regex library and thus# \| matches the literal | and | has special meaning (or) and# () have special meaning and \( \) stand for literal ( ).## type (file matches this if `file %f` matches regular expression desc# (the filename: part from `file %f` is removed))## directory (matches any directory matching regular expression desc)## include (matches an include directive)## default (matches any file no matter what desc is)## Other lines should start with a space or tab and should be in the format:## keyword=commandNL (with no spaces around =), where keyword should be: ## Open (if the user presses Enter or doubleclicks it), ## View (F3), Edit (F4)## Include is the keyword used to add any further entries from an include/# section## command is any one-line shell command, with the following substitutions:## %% -> % character# %p -> name of the current file (without path, but pwd is its path)# %f -> name of the current file. Unlike %p, if file is located on a# non-local virtual filesystem, i.e. either tarfs or ftpfs,# then the file will be temporarily copied into a local directory# and %f will be the full path to this local temporal file.# If you don't want to get a local copy and want to get the# virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then# use %d/%p instead of %f.# %d -> name of the current directory (pwd, without trailing slash)# %s -> "selected files", i.e. space separated list of tagged files if any# or name of the current file# %t -> list of tagged files# %u -> list of tagged files (they'll be untaged after the command)## (If these 6 letters are in uppercase, they refer to the other panel.# But you shouldn't have to use it in this file.)### %cd -> the rest is a path mc should change into (cd won't work, since it's# a child process). %cd handles even vfs names.## %view -> the command you type will be piped into mc's internal file viewer# if you type only the %view and no command, viewer will load %f file# instead (i.e. no piping, so it is different to %view cat %f)# %view may be directly followed by {} with a list of any of# ascii (Ascii mode), hex (Hex mode), nroff (color highlighting for# text using backspace for bold and underscore) and unform# (no highlighting for nroff sequences) separated by commas.## %var -> You use it like this: %var{VAR:default}. This macro will expand# to the value of the VAR variable in the environment if it's set# otherwise the value in default will be used. This is similar to# the Bourne shell ${VAR-default} construct.## Rules are applied from top to bottom, thus the order is important.# If some actions are missing, search continues as if this target didn't# match (i.e. if a file matches the first and second entry and View action# is missing in the first one, then on pressing F3 the View action from# the second entry will be used. default should catch all the actions.## Any new entries you develop for you are always welcome if they are# useful on more than one system. You can post your modifications# as tickets at www.midnight-commander.org################################################################# Image.shell/.xcf Open=(gimp %f &)type/^GIF Include=imagetype/^JPEG Include=imagetype/^PC\ bitmap Include=imagetype/^PNG Include=imagetype/^TIFF Include=imagetype/^PBM Include=imagetype/^PGM Include=imagetype/^PPM Include=imagetype/^Netpbm Include=imageshell/.xbm Open=bitmap %fshell/.xpm Include=image # View=sxpm %fshell/.ico Include=imageinclude/image Open=see %f & View=%view{ascii} identify %f Edit=gimp %f 2>/dev/null &################################################################# Audio.regex/\.([wW][aA][vV]|[sS][nN][dD]|[vV][oO][cC]|[aA][uU]|[sS][mM][pP]|[aA][iI][fF][fF]|[sS][nN][dD])$ Include=audioregex/\.([mM][pP]3)$ Include=audioinclude/audio Open=vlc %f&################################################################# Video.regex/\.([wW][mM][vV])$ Include=videoregex/\.([fF][lL][iIcCvV])$ Include=videoregex/\.([mM][pP]4|[mM][pP][eE]?[gG])$ Include=videoregex/\.([aA][vV][iI])$ Include=videoregex/\.(3[gG][pP])$ Include=videoregex/\.([aA][sS][fFxX])$ Include=videoregex/\.([dD][iI][vV][xX])$ Include=videoregex/\.([mM][kK][vV])$ Include=videoregex/\.([mM][oO][vV]|[qQ][tT])$ Include=video# MPEG-2 TS container + H.264 codecregex/\.([mM][tT][sS])$ Include=videoregex/\.([vV][oO][bB])$ Include=videoregex/\.([wW][mM][vV])$ Include=videoregex/\.([oO][gG][mM])$ Include=videoinclude/video Open=vlc %f################################################################# Plain and binary documents.# GNU Info pagetype/^Info\ text Open=info -f %fshell/.info Open=info -f %ftype/^PDF Open=xpdf -q %f 2>/dev/null &shell/.chm Open=xchm %f 2>/dev/null &shell/.djvu Open=djview %f 2>/dev/null &shell/.fb2 Open=fbreader %f 2>/dev/null &shell/.epub Open=fbreader %f 2>/dev/null &shell/.mobi Open=fbreader %f 2>/dev/null ®ex/\.([rR][tT][fF])$ Open=fbreader %f 2>/dev/null & View=%view{ascii} catdoc -w %fregex/\.[hH][tT][mM][lL]?$ Open=see %f 2>/dev/null ®ex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$ Include=mswordtype/^Microsoft\ Word Include=mswordtype/^Microsoft\ Office\ Document Include=mswordinclude/msword Open=see %f >/dev/null 2>&1 & View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f################################################################# Build rules.# Makefileregex/[Mm]akefile$ Open=make -f %f %{Enter parameters}# Imakefileshell/Imakefile Open=xmkmf -a# Makefile.PL (MakeMaker)regex/^Makefile.(PL|pl)$ Open=%var{PERL:perl} %f################################################################# Open in Emacs.regex/\.(c|cpp|cxx)$ Open=e %f # Open=sensible-editor %fregex/\.(h|hpp)$ Open=e %fregex/\.(s|S)$ Open=e %fshell/.java Open=e %fshell/.f Open=e %fregex/\.([Tt][Ee][Xx])$ Open=e %f #Open=%var{EDITOR:vi} %fregex/\.(sh|bash|tcsh)$ Edit=e %fregex/\.(te?xi|texinfo)$ Open=e %f################################################################# Object files.regex/\.(o|obj)$ View=%view{ascii} file %f && nm %fregex/\.(so|so\.[0-9\.]*)$ View=%view{ascii} file %f && nm -C -D %ftype/^ELF View=%view{ascii} file %f && nm -C %fshell/.class View=%view{ascii} tmp=%p; javap -c ${tmp%%.class}################################################################# Wine. Windows executable.regex/\.[eE][xX][eE]$ Open=wine %f & View=%view{ascii} i586-mingw32msvc-objdump -fx %f || i686-w64-mingw32-objdump -fx %fregex/\.[mM][sS][iI]$ Open=msiexec /i %f ®ex/\.[dD][lL][lL]$ View=%view{ascii} i586-mingw32msvc-objdump -tTrR -fx %f || i686-w64-mingw32-objdump -tTrR -fx %f################################################################# Game/console ROMs.shell/.nes Include=nesgametype/^iNES ROM dump Include=nesgameinclude/nesgame Open=nes %f & View=%view{ascii} file %fshell/.smc Include=snesgameshell/.sfc Include=snesgameshell/.swc Include=snesgameshell/.mgd Include=snesgameshell/.mgh Include=snesgameinclude/snesgame Open=zsnes -v 8 %f & View=%view{ascii} file %ftype/^Sega MegaDrive/Genesis raw ROM dump Include=segagameinclude/segagame Open=gens %f & View=%view{ascii} file %fshell/.n64 Include=n64gameinclude/n64game Open=mupen64plus --windowed --resolution 800x600 --emumode 2 %f & View=%view{ascii} echo I am thinks that %f is a Nindendo 64 rom...################################################################# Misc, tutorial, help rules.shell/.my Open=tmp=%f; echo ${tmp%.my} %f %{Enter opt:} %{Enter file:}