* acinclude.m4 (AC_WITH_SLANG): Don't make symlink from
[midnight-commander.git] / lib / mc.ext.in
blob619d580fc6bf5142bdae13c23709bba815156b24
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), 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/
46 #    section
48 # command is any one-line shell command, with the following substitutions:
50 # %% -> % character
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
99 ### Changes ###
101 # Reorganization: 2000-05-01 Michal Svec <rebel@penguin.cz>
104 ### TODO ###
106 # Postscript    Open: ps2svga [gs -DEVICE=jpeg|zgv or something]
107 # Images                asciiview
108 # RTF           rtf2html
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.
119 ### Sources ###
121 # C
122 shell/.c
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
127 # Fortran
128 shell/.f
129         Open=%var{EDITOR:vi} %f
130         Compile=f77 -O -c %f
131         Compile and Link=f77 -O %f
132         
133 # Header
134 shell/.h
135         Open=%var{EDITOR:vi} %f
137 # Object
138 shell/.o
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
144 # Asm
145 shell/.s
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
150 # C++
151 regex/\.(C|cc)$
152         Open=%var{EDITOR:vi} %f
153         Compile=c++ -O -c %f
154         Link=c++ -O -o %d/`basename %f .c` %f
156 ### Documentation ###
158 # Texinfo
159 regex/\.(te?xi|texinfo)$
161 # GNU Info page
162 type/^Info\ text
163         Open=info -f %f
165 shell/.info
166         Open=info -f %f
168 # Manual page
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.
179 shell/read.me
180         Open=
181         View=
183 shell/.me
184         Open=nroff @TROFFASCII@ -me %f | %var{PAGER:more}
185         View=%view{ascii,nroff} nroff @TROFFASCII@ -me %f
187 # Troff with ms macros.
188 shell/.ms
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@
206 ### Images ###
208 type/^GIF
209         Include=image-options
211 type/^JPEG
212         Include=image-options
214 type/^PC\ bitmap
215         Include=image-options
217 type/^PNG
218         Include=image-options
220 type/^TIFF
221         Include=image-options
223 type/^PBM
224         Include=image-options
226 type/^PGM
227         Include=image-options
229 type/^PPM
230         Include=image-options
232 type/^Netpbm
233         Include=image-options
235 shell/.xcf
236         Open=gimp %f
238 shell/.xbm
239         Open=bitmap %f
241 shell/.xpm
242         Include=image-options
243         View=sxpm %f
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 &
253 ### Sound files ###
255 regex/\.(wav|WAV|Wav|snd|SND|Snd|voc|VOC|Voc|au|AU|Au)$
256        Open=play %f
258 regex/\.(mod|MOD|Mod|s3m|S3M|S3m|xm|XM|Xm)$
259        Open=mikmod %f
260        #Open=tracker %f
262 regex/\.(wav22|WAV22)$
263        Open=vplay -s 22 %f
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?)$
274         Open=timidity %f
276 ### Multimedia ###
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)$
285         Open=(realplay %f &)
288 ### Documents ###
290 # Postscript
291 type/^PostScript
292         Open=(gv %f &)
293         View=%view{ascii} ps2ascii %f
295 # PDF
296 type/^PDF
297         Open=(xpdf %f &)
298         #Open=(acroread %f &)
299         #Open=(ghostview %f &)
300         View=%view{ascii} pdftotext %f -
302 # html
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
309 shell/.sdw
310         Open=(soffice %f &)
312 # AbiWord
313 shell/.abw
314         Open=(abiword %f &)
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
330         Open=(soffice %f &)
332 # Framemaker
333 type/^FrameMaker
334         Open=fmclient -f %f
336 # DVI
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
342 # TeX
343 regex/\.([Tt]ex|TEX|TeX)$
344         Open=%var{EDITOR:vi} %f
345         TeX this file=tex %f
346         LaTeX this file=latex %f
349 ### Miscellaneous ###
351 shell/^RMAIL$
352         Start Emacs on this RMAIL file=emacs %f
353         Open=emacs %f
355 type/^(M|m)ail
356         Open=elm -f %f
357         View=%view{ascii} mcmfmt < %f
359 # core
360 shell/core
362 # Makefile
363 regex/[Mm]akefile$
364         Open=make -f %f %{Enter parameters}
366 # Imakefile
367 shell/Imakefile
368         Open=xmkmf -a
370 # Makefile.PL (MakeMaker)
371 regex/^Makefile.(PL|pl)$
372         Open=%var{PERL:perl} %f
374 # Executables
375 type/\ executable
376         Open=./%f
377         Drop=%f %q
378         Execute in XTerm=xterm -e %f &
379         View Required Libraries=%view{ascii} ldd %f
380         Strip binary=strip %f
382 # dbf
383 regex/\.(dbf|DBF)$
384        Open=%view{ascii} dbview %f
385        View=%view{ascii} dbview -b %f
387 # REXX script
388 regex/\.(rexx|rex|cmd)$
389        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
392 ### Archives ###
394 # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
395 regex/\.t([gp]?z|ar\.g?[zZ])$
396         Open=%cd %p#utar
397         View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
398         Extract=gzip -dc %f 2>/dev/null | tar xf -
399 regex/\.tar\.bz$
400         # Open=%cd %p#utar
401         View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
402         Extract=bzip -dc %f 2>/dev/null | tar xf -
403 regex/\.tar\.bz2$
404         Open=%cd %p#utar
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
409 regex/\.tar\.F$
410         # Open=%cd %p#utar
411         View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -
412         Extract=freeze -dc %f 2>/dev/null | tar xf -
414 # tar
415 regex/\.(tar|TAR)$
416         Open=%cd %p#utar
417         View=%view{ascii} tar tvvf %f
418         Extract=tar xf %f
420 # zip
421 type/^Zip\ archive
422         Open=%cd %p#uzip
423         View=%view{ascii} unzip -v %f
424         Extract=unzip %f
425         Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
426         Unzip=unzip %f '*'
428 # zoo
429 regex/\.(zoo|ZOO)$
430         Open=%cd %p#uzoo
431         View=%view{ascii} zoo l %f
432         Extract=zoo x %f '*'
433         
434 # lha
435 type/^LHa\ .*archive
436         Open=%cd %p#ulha
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
441 # arj
442 regex/\.a(rj|[0-9][0-9])$
443         Open=%cd %p#uarj
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
448 # ha
449 regex/\.(ha|HA|Ha)$
450         Open=%cd %p#uha
451         View=%view{ascii} ha lf %f
452         Extract=ha xy %f '*'
453         Extract (with flags)=I=%{Enter any HA flags:}; if test -n "$I"; then ha xy $I %f; fi
455 # rar
456 regex/\.[rR]([aA][rR]|[0-9][0-9])$
457         Open=%cd %p#urar
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
462 # cpio
463 shell/.cpio.Z
464         Open=%cd %p#ucpio
465         View=%view{ascii} compress -dc '%f' | cpio -ictv
466         Extract=compress -dc '%f' | cpio -ic
467 shell/.cpio.gz
468         Open=%cd %p#ucpio
469         View=%view{ascii} gzip -dc '%f' | cpio -ictv
470         Extract=gzip -dc '%f' | cpio -ic
471 shell/.cpio
472         Open=%cd %p#ucpio
473         View=%view{ascii} cat '%f' | cpio -ictv
474         Extract=cat '%f' | cpio -ic
476 # ls-lR
477 regex/(^|\.)ls-?lR$
478         Open=%cd %p#lslR
479 regex/(^|\.)ls-?lR\.(g?z|Z)$
480         Open=%cd %p#lslR
481         View=%view{ascii} gunzip -c %f
483 # ftplist
484 regex/\.ftplist$
485         Open=%cd %p#ftplist
487 # gzip
488 type/^gzip
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
492         Uncompress=gunzip %f
494 # bzip2
495 type/^bzip2
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
501 # bzip
502 type/^bzip
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
506         Uncompress=bunzip %f
508 # compress
509 type/^compress
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
514 # ar library
515 regex/\.s?a$
516         Open=%cd %p#uar
517         #Open=%view{ascii} ar tv %f
518         View=%view{ascii} nm %f
520 # trpm
521 regex/\.trpm$
522         Open=%cd %p#trpm
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)$
527         Open=%cd %p#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
533 # Compiled RPMs
534 regex/\.rpm$
535         Open=%cd %p#rpm
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
541 # deb
542 regex/\.deb$
543         Open=%cd %p#deb
544         View=%view{ascii} dpkg-deb -c %f
547 ### Directories ###
549 directory/^\.\.$
550 directory/^News$
551 directory/^Mail$
552 directory/^\..*$
553 directory/^.*$
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
558 ### Default ###
560 # Default target for anything not described above
561 default/*
562         Open=
563         View=
564         Drop=
565         Title=%p
568 ### EOF ###