1 # Midnight Commander 3.0 extension file
2 # Warning: Structure of this file has changed completely with version 3.0
4 # All lines starting with # or empty lines are thrown away.
5 # Lines starting in the first column should have following format:
7 # keyword/descNL, i.e. everything after keyword/ until new line is desc
11 # shell (desc is, when starting with a dot, any extension (no wildcars),
12 # i.e. matches all the files *desc . Example: .tar matches *.tar;
13 # if it doesn't start with a dot, it matches only a file of that name)
15 # regex (desc is an extended regular expression)
16 # Please note that we are using the GNU regex library and thus
17 # \| matches the literal | and | has special meaning (or) and
18 # () have special meaning and \( \) stand for literal ( ).
20 # type (file matches this if `file %f` matches regular expression desc
21 # (the filename: part from `file %f` is removed))
23 # directory (matches any directory matching regular expression desc)
25 # include (matches an include directive)
27 # default (matches any file no matter what desc is)
29 # Other lines should start with a space or tab and should be in the format:
31 # keyword=commandNL (with no spaces around =), where keyword should be:
33 # Open (if the user presses Enter or doubleclicks it),
35 # View (F3), Edit (F4), Drop (user drops some files on it) or any other
37 # user defined name (those will be listed in the extension dependent popup
38 # menu). This is not implemented yet for the text edition but will be
39 # implemented some day so feel free to add useful actions here.
41 # Title is the default icon title for objects. %p is expanded into the
42 # name of that file and %d/%p to a name with full path. Default title
43 # (if none is specified) is %p
45 # Include is the keyword used to add any further entries from an include/
48 # command is any one-line shell command, with the following substitutions:
51 # %p -> name of the current file (without path, but pwd is its path)
52 # %f -> name of the current file. Unlike %p, if file is located on a
53 # non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
54 # then the file will be temporarily copied into a local directory
55 # and %f will be the full path to this local temporal file.
56 # If you don't want to get a local copy and want to get the
57 # virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
58 # use %d/%p instead of %f.
59 # %d -> name of the current directory (pwd, without trailing slash)
60 # %s -> "selected files", i.e. space separated list of tagged files if any
61 # or name of the current file
62 # %t -> list of tagged files
63 # %u -> list of tagged files (they'll be untaged after the command)
65 # (If these 6 letters are in uppercase, they refer to the other panel.
66 # But you shouldn't have to use it in this file.)
69 # %cd -> the rest is a path mc should change into (cd won't work, since it's
70 # a child process). %cd handles even vfs names.
72 # %view -> the command you type will be piped into mc's internal file viewer
73 # if you type only the %view and no command, viewer will load %f file
74 # instead (i.e. no piping, so it is different to %view cat %f)
75 # %view may be directly followed by {} with a list of any of
76 # ascii (Ascii mode), hex (Hex mode), nroff (color highlighting for
77 # text using backspace for bold and underscore) and unform
78 # (no highlighting for nroff sequences) separated by commas.
80 # %var -> You use it like this: %var{VAR:default}. This macro will expand
81 # to the value of the VAR variable in the environment if it's set
82 # otherwise the value in default will be used. This is similar to
83 # the Bourne shell ${VAR-default} construct.
85 # %q -> will be replaced with a list of files user dropped on it
86 # with full pathnames (only applicable in the Drop command).
88 # Rules are applied from top to bottom, thus the order is important.
89 # If some actions are missing, search continues as if this target didn't
90 # match (i.e. if a file matches the first and second entry and View action
91 # is missing in the first one, then on pressing F3 the View action from
92 # the second entry will be used. default should catch all the actions.
94 # Any new entries you develop for you are always welcome if they are
95 # useful on more than one system. You can send your modifications
96 # by e-mail to mc-devel@gnome.org
101 # Reorganization: 2000-05-01 Michal Svec <rebel@penguin.cz>
106 # Postscript Open: ps2svga [gs -DEVICE=jpeg|zgv or something]
110 # All X Apps [Nothing/Warning] if no DISPLAY
111 # Not found [Default/Warning]
112 # Empty Output [Default/Warning]
113 # Edit: CopyOut+EDIT+CopyIn
114 # Security Check gzip/bzip EDIT (mktemp)
116 # Maybe: Open/XOpen/GOpen/KOpen/... for Console/X/GNOME/KDE/etc.
123 Open=%var{EDITOR:vi} %f
124 Compile=%var{CC:cc} -O -c %f
125 Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
129 Open=%var{EDITOR:vi} %f
131 Compile and Link=f77 -O %f
135 Open=%var{EDITOR:vi} %f
139 #Open=%var{PAGER:more} %f
140 View=%view{ascii} nm %f
141 Link=%var{CC:cc} -O %f
142 Disassemble=%view{ascii} objdump -d -r %f
146 Open=%var{EDITOR:vi} %f
147 Assemble=%var{CC:cc} -O -c %f
148 Link=%var{CC:cc} -O -o %d/`basename %f .s` %f
152 Open=%var{EDITOR:vi} %f
154 Link=c++ -O -o %d/`basename %f .c` %f
156 ### Documentation ###
159 regex/\.(te?xi|texinfo)$
169 # Exception - .so libraries are not manual pages
170 regex/\.(so|so\.[0-9\.]*)$
171 View=%view{ascii} nm %f
173 regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
174 Open=nroff @TROFFASCII@ @MANDOC@ %f | %var{PAGER:more}
175 View=%view{ascii,nroff} nroff @TROFFASCII@ @MANDOC@ %f
177 # Troff with me macros.
178 # Exception - "read.me" is not a nroff file.
184 Open=nroff @TROFFASCII@ -me %f | %var{PAGER:more}
185 View=%view{ascii,nroff} nroff @TROFFASCII@ -me %f
187 # Troff with ms macros.
189 Open=nroff @TROFFASCII@ -ms %f | %var{PAGER:more}
190 View=%view{ascii,nroff} nroff @TROFFASCII@ -ms %f
192 # Manual page - compressed
193 regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
194 Open=gzip -dc %f | nroff @TROFFASCII@ @MANDOC@ | %var{PAGER:more}
195 View=%view{ascii,nroff} gzip -dc %f | nroff @TROFFASCII@ @MANDOC@
197 regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz$
198 Open=bzip -dc %f | nroff @TROFFASCII@ @MANDOC@ | %var{PAGER:more}
199 View=%view{ascii,nroff} bzip -dc %f | nroff @TROFFASCII@ @MANDOC@
201 regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz2$
202 Open=bzip2 -dc %f | nroff @TROFFASCII@ @MANDOC@ | %var{PAGER:more}
203 View=%view{ascii,nroff} bzip2 -dc %f | nroff @TROFFASCII@ @MANDOC@
209 Include=image-options
212 Include=image-options
215 Include=image-options
218 Include=image-options
221 Include=image-options
224 Include=image-options
227 Include=image-options
230 Include=image-options
233 Include=image-options
242 Include=image-options
245 include/image-options
246 Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (ee %f &); fi
247 View=%view{ascii} identify %f
248 #View=%view{ascii} asciiview %f
249 Set root window to this image=background-properties --setwallpaper %f &
250 Display this file=ee %f &
255 regex/\.(wav|WAV|Wav|snd|SND|Snd|voc|VOC|Voc|au|AU|Au)$
258 regex/\.(mod|MOD|Mod|s3m|S3M|S3m|xm|XM|Xm)$
262 regex/\.(wav22|WAV22)$
265 regex/\.(mp3|MP3|Mp3)$
266 Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else (xmms %f &); fi
267 View=%view{ascii} mpg123 -vtn1 %f 2>&1 | sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
269 regex/\.(ogg|OGG|Ogg)$
270 Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f &); fi
271 View=%view{ascii} ogginfo %s
273 regex/\.(midi?|MIDI?|Midi?)$
278 regex/\.(mpe?g|MPE?G|Mpe?g)$
279 Open=(gtv %f 2>/dev/null &)
281 regex/\.(avi|AVI|Avi|mov|MOV|Mov)$
282 Open=(xanim %f 2>/dev/null &)
284 regex/\.(rm|RM|Rm|ram|RAM|Ram)$
293 View=%view{ascii} ps2ascii %f
298 #Open=(acroread %f &)
299 #Open=(ghostview %f &)
300 View=%view{ascii} pdftotext %f -
303 regex/\.([Hh]tml?|HTML?)$
304 #Open=if echo "%d/%p" | grep ^ftp; then $viewer %d/%p; else $viewer file:%p; fi
305 Open=if test -n "@X11_WWW@" && test -n "$DISPLAY"; then echo @X11_WWW@ %f; (@X11_WWW@ %f &) >/dev/null 2>&1; else lynx -force_html %f; fi
306 View=%view{ascii} lynx -dump -force_html %f;
308 # StarOffice and OpenOffice
316 # Microsoft Word Document
317 regex/\.([Dd]o[ct]|DO[CT]|[Ww]ri|WRI)$
318 View=%view{ascii} catdoc -w %f || word2x -f text %f - || strings %f
319 type/^Microsoft\ Word
320 View=%view{ascii} catdoc -w %f || word2x -f text %f - || strings %f
322 # Microsoft Excel Worksheet
323 regex/\.([Xx]l[sw]|XL[SW])$
324 View=%view{ascii} xls2csv %f || strings %f
325 type/^Microsoft\ Excel
326 View=%view{ascii} xls2csv %f || strings %f
328 # Use StarOffice to open any MS Office documents
329 type/^Microsoft\ Office\ Document
337 regex/\.([Dd]vi|DVI)$
338 Open=if [ x$DISPLAY = x ]; then dvisvga %f; else (xdvi %f &); fi
339 View=%view{ascii} dvi2tty %f
340 Convert file to Postscript=dvips %f
343 regex/\.([Tt]ex|TEX|TeX)$
344 Open=%var{EDITOR:vi} %f
346 LaTeX this file=latex %f
349 ### Miscellaneous ###
352 Start Emacs on this RMAIL file=emacs %f
357 View=%view{ascii} mcmfmt < %f
364 Open=make -f %f %{Enter parameters}
370 # Makefile.PL (MakeMaker)
371 regex/^Makefile.(PL|pl)$
372 Open=%var{PERL:perl} %f
378 Execute in XTerm=xterm -e %f &
379 View Required Libraries=%view{ascii} ldd %f
380 Strip binary=strip %f
384 Open=%view{ascii} dbview %f
385 View=%view{ascii} dbview -b %f
388 regex/\.(rexx|rex|cmd)$
389 Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
394 # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
395 regex/\.t([gp]?z|ar\.g?[zZ])$
397 View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
398 Extract=gzip -dc %f 2>/dev/null | tar xf -
401 View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
402 Extract=bzip -dc %f 2>/dev/null | tar xf -
405 View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
406 Extract=bzip2 -dc %f 2>/dev/null | tar xf -
408 # .tar.F - used in QNX
411 View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -
412 Extract=freeze -dc %f 2>/dev/null | tar xf -
417 View=%view{ascii} tar tvvf %f
423 View=%view{ascii} unzip -v %f
425 Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
431 View=%view{ascii} zoo l %f
437 View=%view{ascii} lharc l %f
438 Extract=lharc x %f '*'
439 Extract (with flags)=I=%{Enter any LHarc flags:}; if test -n "$I"; then lharc x $I %f; fi
442 regex/\.a(rj|[0-9][0-9])$
444 View=%view{ascii} unarj l %f
445 Extract=unarj x %f '*'
446 Extract (with flags)=I=%{Enter any Unarj flags:}; if test -n "$I"; then unarj x $I %f; fi
451 View=%view{ascii} ha lf %f
453 Extract (with flags)=I=%{Enter any HA flags:}; if test -n "$I"; then ha xy $I %f; fi
456 regex/\.[rR]([aA][rR]|[0-9][0-9])$
458 View=%view{ascii} rar v -c- %f
459 Extract=rar x -c- %f '*'
460 Extract (with flags)=I=%{Enter any RAR flags:}; if test -n "$I";then rar x $I %f; fi
465 View=%view{ascii} compress -dc '%f' | cpio -ictv
466 Extract=compress -dc '%f' | cpio -ic
469 View=%view{ascii} gzip -dc '%f' | cpio -ictv
470 Extract=gzip -dc '%f' | cpio -ic
473 View=%view{ascii} cat '%f' | cpio -ictv
474 Extract=cat '%f' | cpio -ic
479 regex/(^|\.)ls-?lR\.(g?z|Z)$
481 View=%view{ascii} gunzip -c %f
489 Open=gzip -dc %f | %var{PAGER:more}
490 View=%view{ascii} gzip -dc %f 2>/dev/null
491 Edit=I=`date +%%s`; export I; gzip -cd %f >/tmp/gzed.$I && %var{EDITOR:vi} /tmp/gzed.$I && gzip -c /tmp/gzed.$I > %f; rm -f /tmp/gzed.$I
496 Open=bzip2 -dc %f | %var{PAGER:more}
497 View=%view{ascii} bzip2 -dc %f 2>/dev/null
498 Edit=I=`date +%%s`; export I; bzip2 -cd %f >/tmp/bzed.$I && %var{EDITOR:vi} /tmp/bzed.$I && bzip2 -c /tmp/bzed.$I > %f; rm -f /tmp/bzed.$I
499 Uncompress=bunzip2 %f
503 Open=bzip -dc %f | %var{PAGER:more}
504 View=%view{ascii} bzip -dc %f 2>/dev/null
505 Edit=I=`date +%%s`; export I; bzip -cd %f >/tmp/bzed.$I && %var{EDITOR:vi} /tmp/bzed.$I && bzip -c /tmp/bzed.$I > %f; rm -f /tmp/bzed.$I
510 Open=gzip -dc %f | %var{PAGER:more}
511 View=%view{ascii} gzip -dc %f 2>/dev/null
512 Edit=I=`date +%%s`; export I; gzip -cd %f >/tmp/gzed.$I && %var{EDITOR:vi} /tmp/gzed.$I && gzip -c /tmp/gzed.$I > %f; rm -f /tmp/gzed.$I
517 #Open=%view{ascii} ar tv %f
518 View=%view{ascii} nm %f
523 View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
525 # Source RPMs (SuSE uses *.spm, others use *.src.rpm)
526 regex/\.(spm|src\.rpm)$
528 View=%view{ascii} rpm -qivlp --scripts %f
529 Install this RPM=rpm -i %f
530 Rebuild this RPM=rpm --rebuild %f
531 Check signature=rpm --checksig %f
536 View=%view{ascii} rpm -qivlp --scripts %f
537 Install this RPM=rpm -i %f
538 Upgrade this RPM=rpm -U %f
539 Check signature=rpm --checksig %f
544 View=%view{ascii} dpkg-deb -c %f
554 Start XTerm here=cd %p; exec xterm &
555 Make tar.gz=I=%{Enter destination file name:}; if test -n "$I"; then tar cvf - %p | gzip > $I; fi
560 # Default target for anything not described above