Added doxygen stuff.
[midnight-commander.git] / lib / mc.ext.in
blobddcd3a580d3ec9a5441ce39121b742f482239a68
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
9 # keyword can be: 
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)
37 #    Include is the keyword used to add any further entries from an include/
38 #    section
40 # command is any one-line shell command, with the following substitutions:
42 # %% -> % character
43 # %p -> name of the current file (without path, but pwd is its path)
44 # %f -> name of the current file. Unlike %p, if file is located on a 
45 #       non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
46 #       then the file will be temporarily copied into a local directory
47 #       and %f will be the full path to this local temporal file.
48 #       If you don't want to get a local copy and want to get the
49 #       virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
50 #       use %d/%p instead of %f.
51 # %d -> name of the current directory (pwd, without trailing slash)
52 # %s -> "selected files", i.e. space separated list of tagged files if any
53 #       or name of the current file
54 # %t -> list of tagged files
55 # %u -> list of tagged files (they'll be untaged after the command)
57 # (If these 6 letters are in uppercase, they refer to the other panel.
58 # But you shouldn't have to use it in this file.)
61 # %cd -> the rest is a path mc should change into (cd won't work, since it's
62 #       a child process).  %cd handles even vfs names.
64 # %view -> the command you type will be piped into mc's internal file viewer
65 #       if you type only the %view and no command, viewer will load %f file
66 #       instead (i.e. no piping, so it is different to %view cat %f)
67 #       %view may be directly followed by {} with a list of any of
68 #       ascii (Ascii mode), hex (Hex mode), nroff (color highlighting for
69 #       text using backspace for bold and underscore) and unform
70 #       (no highlighting for nroff sequences) separated by commas.
72 # %var -> You use it like this: %var{VAR:default}.  This macro will expand
73 #       to the value of the VAR variable in the environment if it's set
74 #       otherwise the value in default will be used.  This is similar to
75 #       the Bourne shell ${VAR-default} construct.
77 # Rules are applied from top to bottom, thus the order is important.
78 # If some actions are missing, search continues as if this target didn't
79 # match (i.e. if a file matches the first and second entry and View action
80 # is missing in the first one, then on pressing F3 the View action from
81 # the second entry will be used. default should catch all the actions.
83 # Any new entries you develop for you are always welcome if they are
84 # useful on more than one system.  You can send your modifications
85 # by e-mail to mc-devel@gnome.org
88 ### Changes ###
90 # Reorganization: 2000-05-01 Michal Svec <rebel@penguin.cz>
93 ### TODO ###
95 # Postscript    Open: ps2svga [gs -DEVICE=jpeg|zgv or something]
96 # Images                asciiview
97
98 # All X Apps    [Nothing/Warning] if no DISPLAY
99 # Not found     [Default/Warning]
100 # Empty Output  [Default/Warning]
101 # Edit:         CopyOut+EDIT+CopyIn
102 # Security      Check gzip/bzip EDIT (mktemp)
104 # Maybe:        Open/XOpen/GOpen/KOpen/... for Console/X/GNOME/KDE/etc.
107 ### Archives ###
109 # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk
110 regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$
111         Open=%cd %p#utar
112         View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
114 regex/\.tar\.bz$
115         # Open=%cd %p#utar
116         View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
118 regex/\.t(ar\.bz2|bz|b2)$
119         Open=%cd %p#utar
120         View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
122 # .tar.lzma, .tlz
123 regex/\.t(ar\.lzma|lz)$
124         Open=%cd %p#utar
125         View=%view{ascii} lzma -dc %f 2>/dev/null | tar tvvf -
127 # .tar.F - used in QNX
128 regex/\.tar\.F$
129         # Open=%cd %p#utar
130         View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -
132 # .qpr/.qpk - QNX Neutrino package installer files 
133 regex/\.(qp[rk])$
134         Open=%cd %p#utar
135         View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
137 # tar
138 regex/\.(tar|TAR)$
139         Open=%cd %p#utar
140         View=%view{ascii} tar tvvf - %f
142 # lha
143 type/^LHa\ .*archive
144         Open=%cd %p#ulha
145         View=%view{ascii} lha l %f
147 # arj
148 regex/\.a(rj|[0-9][0-9])$
149         Open=%cd %p#uarj
150         View=%view{ascii} unarj l %f
152 # ha
153 regex/\.([Hh][Aa])$
154         Open=%cd %p#uha
155         View=%view{ascii} ha lf %f
157 # rar
158 regex/\.[rR]([aA][rR]|[0-9][0-9])$
159         Open=%cd %p#urar
160         View=%view{ascii} rar v -c- %f
162 # ALZip
163 regex/\.(alz|ALZ)$
164         Open=%cd %p#ualz
165         View=%view{ascii} unalz -l %f
167 # cpio
168 shell/.cpio.Z
169         Open=%cd %p#ucpio
170         View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null
172 shell/.cpio.gz
173         Open=%cd %p#ucpio
174         View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null
176 shell/.cpio
177         Open=%cd %p#ucpio
178         View=%view{ascii} cpio -itv < %f 2>/dev/null
180 # ls-lR
181 regex/(^|\.)ls-?lR(\.gz|Z|bz2)$
182         Open=%cd %p#lslR
184 # patch
185 regex/\.(diff|patch)(\.bz2)$
186         Open=%cd %p#patchfs
187         View=%view{ascii} bzip2 -dc %f 2>/dev/null
189 regex/\.(diff|patch)(\.(gz|Z))$
190         Open=%cd %p#patchfs
191         View=%view{ascii} gzip -dc %f 2>/dev/null
193 regex/\.(diff|patch)$
194         Open=%cd %p#patchfs
195         View=%view{ascii} /bin/cat %f 2>/dev/null
197 # ar library
198 regex/\.s?a$
199         Open=%cd %p#uar
200         #Open=%view{ascii} ar tv %f
201         View=%view{ascii} file %f && nm %f
203 # trpm
204 regex/\.trpm$
205         Open=%cd %p#trpm
206         View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
208 # RPM packages (SuSE uses *.spm for source packages)
209 regex/\.(rpm|spm)$
210         Open=%cd %p#rpm
211         View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f
213 # deb
214 regex/\.u?deb$
215         Open=%cd %p#deb
216         View=%view{ascii} dpkg-deb -I %f && echo && dpkg-deb -c %f
218 # ISO9660
219 regex/\.iso$
220         Open=%cd %p#iso9660
221         View=%view{ascii} isoinfo -l -i %f
223 # 7zip archives (they are not man pages)
224 regex/\.(7z|7Z)$
225         Open=%cd %p#u7z
226         View=%view{ascii} 7za l %f 2>/dev/null
228 # Mailboxes
229 type/^ASCII\ mail\ text
230         Open=%cd %p#mailfs
233 ### Sources ###
235 # C
236 shell/.c
237         Open=%var{EDITOR:vi} %f
239 # Fortran
240 shell/.f
241         Open=%var{EDITOR:vi} %f
242         
243 # Header
244 regex/\.(h|hpp)$
245         Open=%var{EDITOR:vi} %f
247 # Object
248 type/^ELF
249         #Open=%var{PAGER:more} %f
250         View=%view{ascii} file %f && nm %f
252 # Asm
253 shell/.s
254         Open=%var{EDITOR:vi} %f
256 # C++
257 regex/\.(C|cc|cpp)$
258         Open=%var{EDITOR:vi} %f
261 ### Documentation ###
263 # Texinfo
264 regex/\.(te?xi|texinfo)$
266 # GNU Info page
267 type/^Info\ text
268         Open=info -f %f
270 shell/.info
271         Open=info -f %f
273 # Manual page
274 # Exception - .so libraries are not manual pages
275 regex/\.(so|so\.[0-9\.]*)$
276         View=%view{ascii} file %f && nm %f
278 regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$
279         Open=case %d/%f in */log/*|*/logs/*) cat %f ;; *) nroff @MAN_FLAGS@ @MANDOC@ %f ;; esac | %var{PAGER:more}
280         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) cat %f ;; *) nroff @MAN_FLAGS@ @MANDOC@ %f ;; esac
282 # Perl pod page
283 shell/.pod
284         Open=pod2man %f | nroff @MAN_FLAGS@ @MANDOC@ | %var{PAGER:more}
285         View=%view{ascii,nroff} pod2man %f | nroff @MAN_FLAGS@ @MANDOC@
287 # Troff with me macros.
288 # Exception - "read.me" is not a nroff file.
289 shell/read.me
290         Open=
291         View=
293 shell/.me
294         Open=nroff @MAN_FLAGS@ -me %f | %var{PAGER:more}
295         View=%view{ascii,nroff} nroff @MAN_FLAGS@ -me %f
297 # Troff with ms macros.
298 shell/.ms
299         Open=nroff @MAN_FLAGS@ -ms %f | %var{PAGER:more}
300         View=%view{ascii,nroff} nroff @MAN_FLAGS@ -ms %f
302 # Manual page - compressed
303 regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$
304         Open=case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
305         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
307 regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$
308         Open=case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
309         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
311 regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$
312         Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
313         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
315 regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$
316         Open=case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
317         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
320 ### Images ###
322 type/^GIF
323         Include=image
325 type/^JPEG
326         Include=image
328 type/^PC\ bitmap
329         Include=image
331 type/^PNG
332         Include=image
334 type/^TIFF
335         Include=image
337 type/^PBM
338         Include=image
340 type/^PGM
341         Include=image
343 type/^PPM
344         Include=image
346 type/^Netpbm
347         Include=image
349 shell/.xcf
350         Open=(gimp %f &)
352 shell/.xbm
353         Open=bitmap %f
355 shell/.xpm
356         Include=image
357         View=sxpm %f
359 include/image
360         Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (gqview %f &); fi
361         View=%view{ascii} identify %f
362         #View=%view{ascii} asciiview %f
365 ### Sound files ###
367 regex/\.([wW][aA][vV]|[sS][nN][dD]|[vV][oO][cC]|[aA][uU]|[sS][mM][pP]|[aA][iI][fF][fF]|[sS][nN][dD])$
368        Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi
370 regex/\.([mM][oO][dD]|[sS]3[mM]|[xX][mM]|[iI][tT]|[mM][tT][mM]|669|[sS][tT][mM]|[uU][lL][tT]|[fF][aA][rR])$
371        Open=mikmod %f
372        #Open=tracker %f
374 regex/\.([wW][aA][wW]22)$
375        Open=vplay -s 22 %f
377 regex/\.([mM][pP]3)$
378         Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else (xmms %f >/dev/null 2>&1 &); fi
379         View=%view{ascii} mpg123 -vtn1 %f 2>&1 | sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
381 regex/\.([oO][gG][gG])$
382         Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f >/dev/null 2>&1 &); fi
383         View=%view{ascii} ogginfo %s
385 regex/\.([mM][iI][dD][iI]?|[rR][mM][iI][dD]?)$
386         Open=timidity %f
388 regex/\.([wW][mM][aA])$
389         Open=mplayer -vo null %f
390         View=%view{ascii} mplayer -quiet -slave -frames 0 -vo null -ao null -identify %f 2>/dev/null | tail +13 || file %f
393 ### Play lists ###
395 regex/\.([mM]3[uU]|[pP][lL][sS])$
396         Open=if [ -z "$DISPLAY" ]; then mplayer -vo null -playlist %f; else (xmms -p %f >/dev/null 2>&1 &); fi
399 ### Video ###
401 regex/\.([aA][vV][iI])$
402         Include=video
404 regex/\.([aA][sS][fFxX])$
405         Include=video
407 regex/\.([dD][iI][vV][xX])$
408         Include=video
410 regex/\.([mM][oO][vV]|[qQ][tT])$
411         Include=video
413 regex/\.([mM][pP]4|[mM][pP][eE]?[gG])$
414         Include=video
416 regex/\.([vV][oO][bB])$
417         Include=video
419 regex/\.([wW][mM][vV])$
420         Include=video
422 regex/\.([fF][lL][iIcCvV])$
423         Include=video
425 regex/\.([oO][gG][mM])$
426         Include=video
428 regex/\.([rR][aA]?[mM])$
429         Open=(realplay %f >/dev/null 2>&1 &)
431 include/video
432         Open=(mplayer %f >/dev/null 2>&1 &)
433         #Open=(gtv %f >/dev/null 2>&1 &)
434         #Open=(xanim %f >/dev/null 2>&1 &)
437 ### Documents ###
439 # Postscript
440 type/^PostScript
441         Open=(gv %f &)
442         View=%view{ascii} ps2ascii %f
444 # PDF
445 type/^PDF
446         Open=(xpdf %f &)
447         #Open=(acroread %f &)
448         #Open=(ghostview %f &)
449         View=%view{ascii} pdftotext %f -
451 # The following code very ugly and should not be taken as example.
452 # It should be cleaned up when the new format of mc.ext is developed.
454 # html
455 regex/\.([hH][tT][mM][lL]?)$
456         Open=(if test -n "@X11_WWW@" && test -n "$DISPLAY"; then (@X11_WWW@ file://%d/%p &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null
457         View=%view{ascii} links -dump %f 2>/dev/null || w3m -dump %f 2>/dev/null || lynx -dump -force_html %f
459 # StarOffice 5.2
460 shell/.sdw
461         Open=(ooffice %f &)
463 # StarOffice 6 and OpenOffice.org formats
464 regex/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
465         Open=(ooffice %f &)
466         View=%view{ascii} odt2txt %f
468 # AbiWord
469 shell/.abw
470         Open=(abiword %f &)
472 # Microsoft Word Document
473 regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
474         Open=(abiword %f >/dev/null 2>&1 &)
475         View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
476 type/^Microsoft\ Word
477         Open=(abiword %f >/dev/null 2>&1 &)
478         View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
480 # RTF document
481 regex/\.([rR][tT][fF])$
482         Open=(abiword %f >/dev/null 2>&1 &)
484 # Microsoft Excel Worksheet
485 regex/\.([xX][lL][sSwW])$
486         Open=(gnumeric %f >/dev/null 2>&1 &)
487         View=%view{ascii} xls2csv %f || strings %f
488 type/^Microsoft\ Excel
489         Open=(gnumeric %f >/dev/null 2>&1 &)
490         View=%view{ascii} xls2csv %f || strings %f
492 # Use OpenOffice.org to open any MS Office documents
493 type/^Microsoft\ Office\ Document
494         Open=(ooffice %f &)
496 # Framemaker
497 type/^FrameMaker
498         Open=fmclient -f %f
500 # DVI
501 regex/\.([dD][vV][iI])$
502         Open=if [ x$DISPLAY = x ]; then dvisvga %f; else (xdvi %f &); fi
503         View=%view{ascii} dvi2tty %f
505 # TeX
506 regex/\.([Tt][Ee][Xx])$
507         Open=%var{EDITOR:vi} %f
510 ### Miscellaneous ###
512 # Makefile
513 regex/[Mm]akefile$
514         Open=make -f %f %{Enter parameters}
516 # Imakefile
517 shell/Imakefile
518         Open=xmkmf -a
520 # Makefile.PL (MakeMaker)
521 regex/^Makefile.(PL|pl)$
522         Open=%var{PERL:perl} %f
524 # dbf
525 regex/\.([dD][bB][fF])$
526        Open=%view{ascii} dbview %f
527        View=%view{ascii} dbview -b %f
529 # REXX script
530 regex/\.(rexx?|cmd)$
531        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
533 # Disk images for Commodore computers (VIC20, C64, C128)
534 regex/\.(d64|D64)$
535         Open=%cd %p#uc1541
536         View=%view{ascii} c1541 %f -list
537         Extract=c1541 %f -extract
539 # Glade, a user interface designer for GTK+ and GNOME
540 regex/\.([Gg][Ll][Aa][Dd][Ee])$
541         Open=if glade-3 --version >/dev/null 2>&1; then (glade-3 %f >/dev/null 2>&1 &); else (glade-2 %f >/dev/null 2>&1 &); fi
544 ### Plain compressed files ###
546 # ace
547 regex/\.(ace|ACE)$
548         Open=%cd %p#uace
549         View=%view{ascii} unace l %f
550         Extract=unace x %f
552 # arc
553 regex/\.(arc|ARC)$
554         Open=%cd %p#uarc
555         View=%view{ascii} arc l %f
556         Extract=arc x %f '*'
557         Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi
559 # zip
560 type/^([Zz][Ii][Pp])\ archive
561         Open=%cd %p#uzip
562         View=%view{ascii} unzip -v %f
564 # zoo
565 regex/\.([Zz][Oo][Oo])$
566         Open=%cd %p#uzoo
567         View=%view{ascii} zoo l %f
568         
569 # gzip
570 type/^gzip
571         Open=gzip -dc %f | %var{PAGER:more}
572         View=%view{ascii} gzip -dc %f 2>/dev/null
574 regex/\.(gz|Z)?$
575         View=%view{ascii} gzip -dc %f 2>/dev/null
577 # bzip2
578 type/^bzip2
579         Open=bzip2 -dc %f | %var{PAGER:more}
580         View=%view{ascii} bzip2 -dc %f 2>/dev/null
582 regex/\.bz2?$
583         View=%view{ascii} bzip2 -dc %f 2>/dev/null
585 # bzip
586 type/^bzip
587         Open=bzip -dc %f | %var{PAGER:more}
588         View=%view{ascii} bzip -dc %f 2>/dev/null
590 # compress
591 type/^compress
592         Open=gzip -dc %f | %var{PAGER:more}
593         View=%view{ascii} gzip -dc %f 2>/dev/null
595 # lzma
596 regex/\.lzma$
597         Open=lzma -dc %f | %var{PAGER:more}
598         View=%view{ascii} lzma -dc %f 2>/dev/null
601 ### Default ###
603 # Default target for anything not described above
604 default/*
605         Open=
606         View=
609 ### EOF ###