Added cs to the list of languages
[midnight-commander.git] / lib / mc.ext.in
blob674015763749e1b90bc0671638e5f11e5451941e
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 a 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 \( \) are standing 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 of 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 pop-up
38 #    menu). 
40 #    Icon name is name of the corresponding icon (XPM). If it has no path,
41 #    the default path for mc icons @prefix@/lib/mc/icons is assumed.
43 #    Title is the default icon title for objects. %p is expanded into the
44 #    name of that file and %d/%p to a name with full path. Default title
45 #    (if none is specified) is %p
47 #    Include is the keyword used to add any further entries from an include/
48 #    section
50 # command is any one-line shell command, with the following substitutions:
52 # %% -> % character
53 # %p -> name of the current file (without path, but pwd is its path)
54 # %f -> name of the current file. Unlike %p, if file is located on a 
55 #       non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
56 #       then the file will be temporarily copied into a local directory
57 #       and %f will be the full path to this local temporal file.
58 #       If you don't want to get a local copy and want to get the
59 #       virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
60 #       use %d/%p instead of %f.
61 # %d -> name of the current directory (pwd, without trailing slash)
62 # %s -> "selected files", i.e. space separated list of tagged files if any
63 #       or name of the current file
64 # %t -> list of tagged files
65 # %u -> list of tagged files (they'll be untaged after the command)
67 # (If these 6 letters are in uppercase, they refer to the other panel.
68 # But you shouldn't have to use it in this file.)
71 # %cd -> the rest is not command, but a path which will mc cd internally
72 #       into (cd wouldn't work, since it is a child process, and %cd handles 
73 #       even the vfs names
75 # %view -> the command you type will be piped into mc's internal file viewer
76 #       if you type only the %view and no command, viewer will load %f file
77 #       instead (i.e. no piping, so it is different to %view cat %f)
78 #       %view may be directly followed by {} with a list of any of
79 #       ascii (Ascii mode), hex (Hex mode), nroff (c\bc color highlighting)
80 #       and unformatted (not highlighting nroff sequences) separated by
81 #       spaces.
83 # %var -> You use it like this: %var{ENV-VAR:default}.  This macro will expand
84 #       to the value of the ENV-VAR variable in the environement if it is set
85 #       otherwise the value in default will be used.  This is similar to
86 #       the Bourne shell ${VAR-def} construct.  We use it so that the extension
87 #       file could be used unchanged under some shells that may use different
88 #       methods of doing this
90 # %q -> will be replaced with a list of files user dropped on it
91 #       with full pathnames (only applicable in the Drop command).
93 # Target are evaluted from top to bottom (order is thus important).
94 # If some actions are missing, search continues as if this target didn't
95 # match (i.e. if a file matches the first and second entry and View action
96 # is missing in the first one, then on pressing F3 the View action from
97 # the second entry will be used. default should catch all the actions.
99 # Any handy entries you develop for you are always welcome, if it has
100 # wider usage than on one system. You can send your modifications to
101 # via email to mc-devel@roxanne.nuclecu.unam.mx
103 # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
105 regex/\.t([gp]?z|ar\.g?[zZ])$
106         Open=%cd %p#utar
107         View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
108         Extract=gzip -dc %f 2>/dev/null | tar xf -
109         Icon=compressed.xpm
111 regex/\.tar\.bz$
112 #       Open=%cd %p#utar
113         View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
114         Extract=bzip -dc %f 2>/dev/null | tar xf -
115         Icon=compressed.xpm
117 regex/\.tar\.bz2$
118         Open=%cd %p#utar
119         View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
120         Extract=bzip2 -dc %f 2>/dev/null | tar xf -
121         Icon=compressed.xpm
123 # .tar
124 shell/.tar
125         Open=%cd %p#utar
126         View=%view{ascii} tar tvvf %f
127         Extract=tar xf %f
128         Icon=tar.xpm
130 # bzipped
131 regex/\.bz$
132         Open=bzip -dc %f | %var{PAGER:more}
133         View=%view{ascii} bzip -dc %f 2>/dev/null
134         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
135         Uncompress=bunzip %f
136         Icon=compressed.xpm
138 regex/\.bz2$
139         Open=bzip2 -dc %f | %var{PAGER:more}
140         View=%view{ascii} bzip2 -dc %f 2>/dev/null
141         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
142         Uncompress=bunzip2 %f
143         Icon=compressed.xpm
145 # Programs
146 shell/rm
147         Open=if test ! -d ~/.trash; then mkdir ~/.trash; fi; I=%{Enter file to be safely deleted}; if test -n "$I"; then mv -f -b -V numbered %q ~/.trash; fi
148         Icon=rubbish.xpm
149         Drop=if test ! -d ~/.trash; then mkdir ~/.trash; fi; mv -f -b -V numbered %q ~/.trash
150         Flush=rm -rf ~/.trash
151         Title=Safe delete
153 shell/lpr
154         Open=lpr %{Enter file(s) to print}
155         Icon=printer.xpm
156         Drop=lpr %q
157         Print=lpr %{Enter file(s) to print}
159 shell/gzip
160         Open=gzip %{Enter file to gzip}
161         Icon=compressed.xpm
162         Drop=gzip %q
164 shell/bzip
165         Open=bzip %{Enter file to bzip}
166         Icon=compressed.xpm
167         Drop=bzip %q
169 shell/bzip2
170         Open=bzip2 %{Enter file to bzip}
171         Icon=compressed.xpm
172         Drop=bzip2 %q
174 shell/gunzip
175         Open=gunzip %{Enter file to gunzip}
176         Icon=compressed.xpm
177         Drop=gunzip %q
179 shell/bunzip
180         Open=bunzip %{Enter file to bunzip}
181         Icon=compressed.xpm
182         Drop=bunzip %q
184 shell/bunzip2
185         Open=bunzip2 %{Enter file to bunzip}
186         Icon=compressed.xpm
187         Drop=bunzip2 %q
189 shell/gdb
190         Open=gdb
191         Icon=bug.xpm
192         Drop=gdb %q
194 # a directory
195 directory/^\.\.$
196         Icon=parent_dir.xpm
197 directory/^News$
198         Icon=news_dir.xpm
199 directory/^Mail$
200         Icon=mail_dir.xpm
201 directory/^\..*$
202         Icon=hidden_dir.xpm
203 directory/^.*$
204         Start XTerm here=cd %p; exec xterm &
205         Make tar.gz=I=%{Enter destination file name:}; if test -n "$I"; then tar cvf - %p | gzip > $I; fi
206         Icon=plain_dir.xpm
208 # ls-lR
209 regex/^ls-?lR$
210         Open=%cd %p#lslR
211         View=%view{ascii}
212         Icon=plain_dir.xpm
213 regex/^ls-?lR\.(g?z|Z)$
214         Open=%cd %p#lslR
215         View=%view{ascii} gunzip -c %f
216         Icon=plain_dir.xpm
218 # ftplist
219 regex/\.ftplist$
220         Open=%cd %p#ftplist
222 # rpm
223 regex/\.rpm$
224         Open=%cd %p#rpm
225         Install this RPM=rpm -i %f
226         Upgrade this RPM=rpm -U %f
228 # deb
229 regex/\.deb$
230         Open=%cd %p#deb
231         View=%view{ascii} dpkg-deb -c %f
233 # zip
234 regex/\.(zip|ZIP|jar|JAR)$
235         Open=%cd %p#uzip
236         View=%view{ascii} unzip -v %f
237         Icon=zip.xpm
238         Extract=unzip %f
239         Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
240         Unzip=unzip %f '*'
242 # zoo
243 shell/.zoo
244         Open=%cd %p#uzoo
245         View=%view{ascii} zoo l %f
246         Icon=zoo.xpm
247         Extract=zoo x %f '*'
248         
249 # lha
250 regex/\.(lha|LHA|lzh|LZH)$
251         Open=%cd %p#ulha
252         View=%view{ascii} lharc l %f
253         Icon=lharc.xpm
254         Extract=lharc x %f '*'
255         Extract (with flags)=I=%{Enter any LHarc flags:}; if test -n "$I"; then lharc x $I %f; fi
257 # arj
258 regex/\.a(rj|[0-9][0-9])$
259         Open=%cd %p#uarj
260         View=%view{ascii} unarj l %f
261         Icon=zip.xpm
262         Extract=unarj x %f '*'
263         Extract (with flags)=I=%{Enter any Unarj flags:}; if test -n "$I"; then unarj x $I %f; fi
265 # ar library
266 regex/\.s?a$
267         Open=%cd %p#uar
268         View=%view{ascii} nm %f
270 # C
271 shell/.c
272         Open=%var{PAGER:more} %f
273         View=%view{ascii}
274         Compile=%var{CC:cc} -O -c %f
275         Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
276         Icon=c.xpm
278 shell/.f
279         Open=%var{PAGER:more} %f
280         View=%view{ascii}
281         Compile=f77 -O -c %f
282         Compile and Link=f77 -O %f
283         
284 shell/.h
285         Open=%var{EDITOR:vi} %f
286         Icon=h.xpm
288 shell/.o
289         Open=%var{PAGER:more} %f
290         Link=%var{CC:cc} -O %f
291         Icon=o.xpm
292         Display object file symbols=%view{ascii} nm %f
293         Disassemble=%view{ascii} objdump -d -r %f
295 shell/.s
296         Open=%var{PAGER:more} %f
297         Assemble=%var{CC:cc} -O -c %f
298         Link=%var{CC:cc} -O -o %d/`basename %f .s` %f
299         Icon=s.xpm
301 shell/.dvi
302         Open=xdvi %f
303         Icon=binary.xpm
304         View=xdvi %f
305         Convert file to Postscript=dvips %f
307 shell/.tex
308         Open=%var{PAGER:more} %f
309         Icon=tex.xpm
310         TeX this file=tex %f
311         LaTeX this file=tex %f
313 shell/^RMAIL$
314         Start Emacs on this RMAIL file=emacs %f
315         Open=emacs %f
317 regex/\.(te?xi)|(texinfo)$
318         Icon=tex.xpm
320 # C++
321 regex/\.(C|cc)$
322         Open=%var{PAGER:more} %f
323         View=%view{ascii}
324         Compile=c++ -O -c %f
325         Link=c++ -O -o %d/`basename %f .c` %f
326         Icon=cc.xpm
328 # ar library
329 regex/\.s?a$
330         Open=%view{ascii} ar tv %f
331         View=%view{ascii} nm %f
332         Icon=a.xpm
334 # .so libraries are not manual pages
335 regex/\.so\.[0-9\.]*$
336         View=%view{hex}
337         Icon=so.xpm
339 # GNU Info page
340 type/Info\ text
341         Open=info --directory %d -f %p
342         Icon=info.xpm
344 # Manual page
345 regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
346         Open=nroff @TROFFASCII@ @MANDOC@ %f | %var{PAGER:more}
347         View=%view{ascii,nroff} nroff @TROFFASCII@ @MANDOC@ %f
348         Icon=man.xpm
350 # Troff with me macros.
351 shell/.me
352         Open=nroff @TROFFASCII@ -me %f | %var{PAGER:more}
353         View=%view{ascii,nroff} nroff @TROFFASCII@ -me %f
354         Icon=man.xpm
356 # Troff with ms macros.
357 shell/.ms
358         Open=nroff @TROFFASCII@ -ms %f | %var{PAGER:more}
359         View=%view{ascii,nroff} nroff @TROFFASCII@ -ms %f
360         Icon=man.xpm
362 # Manual page - compressed
363 regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
364         Open=gunzip -dc %f | nroff @TROFFASCII@ @MANDOC@ | %var{PAGER:more}
365         View=%view{ascii,nroff} gunzip -dc %f | nroff @TROFFASCII@ @MANDOC@
366         Icon=man.xpm
368 regex/(read\.?me$)|(README)
369         Icon=info.xpm
371 shell/core
372         Icon=core.xpm
374 type/PostScript
375         Open=gv %f
376         Icon=postscript.xpm
377         View with GhostView=gv %f
379 type/GIF\ image
380         Open=ee %f
381         Icon=gif.xpm
382         Include=image-options
383         
384 type/GIF\ picture
385         Open=ee %f
386         Icon=gif.xpm
387         Include=image-options
388         
389 type/JPEG\ picture
390         Open=ee %f
391         Icon=jpeg.xpm
392         Include=image-options
394 type/PC\ bitmap
395         Open=ee %f
396         Icon=bitmap.xpm
397         Include=image-options
399 type/PNG\ image
400         Open=ee %f
401         Icon=gif.xpm
402         Include=image-options
404 type/JPEG\ image
405         Open=ee %f
406         Icon=jpeg.xpm
407         Include=image-options
408         
409 type/TIFF\ file
410         Open=ee %f
411         Icon=tiff.xpm
412         Include=image-options
413         
414 type/PBM
415         Open=ee %f
416         Icon=pbm.xpm
417         Include=image-options
418         
419 type/PGM
420         Open=ee %f
421         Icon=pgm.xpm
422         Include=image-options
423         
424 type/PPM
425         Open=ee %f
426         Icon=ppm.xpm
427         Include=image-options
429 shell/.xbm
430         Open=bitmap %f
431         Icon=xbm.xpm
433 shell/.xpm
434         Open=ee %f
435         View=sxpm %f
436         Include=image-options
437         Icon=xpm.xpm
439 include/image-options
440         Set root window to this image=background-properties --setwallpaper %f &
441         Display this file=ee %f &
443 # Sound files
444 shell/.mod
445        Open=tracker %f
446        Icon=sound.xpm
447 regex/\.(wav)|(snd)|(voc)|(au)$
448        Open=play %f
449        Icon=sound.xpm
451 type/FrameMaker
452         Open=fmclient -f %f
453         Icon=framemaker.xpm
455 type/mail
456         Open=elm -f %f
457         Icon=mail.xpm
458         View=%view{ascii} mcmfmt < %f
460 # gzipped
461 type/gzip
462         Open=gzip -dc %f | %var{PAGER:more}
463         View=%view{ascii} gzip -dc %f 2>/dev/null
464         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
465         Uncompress=gunzip %f
466         Icon=compressed.xpm
468 type/compress
469         Open=gzip -dc %f | %var{PAGER:more}
470         View=%view{ascii} gzip -dc %f 2>/dev/null
471         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
472         Icon=compressed.xpm
474 # Makefile
475 regex/[Mm]akefile
476         Open=make -f %f %{Enter parameters}
477         Icon=makefile.xpm
479 shell/Imakefile
480         Open=xmkmf -a
481         Icon=makefile.xpm
483 type/PDF
484         Open=xpdf %f
486 # Executables
487 type/executable
488         Open=./%f
489         View=%view
490         Drop=%f %q
491         Execute in XTerm=xterm -e %f &
492         View Required Libraries=%view{ascii} ldd %f
493         Strip binary=strip %f
494         Icon=application.xpm
496 # MPegs
497 regex/\.mpe?g$
498         Open=mpeg_play %f &
499         View (big)=mpeg_play -dither 2x2 %f &
500         View (gray)=mpeg_play -dither gray %f &
502 # HTML
503 regex/\.html?$
504 #       Open=if echo "%d/%p" | grep ^ftp; then $viewer %d/%p; else $viewer file:%p; fi
505         Open=if [ x$DISPLAY = x ]; then lynx -force_html %f; else (@X11_WWW@ %f &); fi
506         View=%view{ascii} lynx -dump -force_html %f; 
507         Icon=html.xpm
508         Run with AppletViewer=appletviewer %f
509         View with @X11_WWW@=@X11_WWW@ file://%f
511 # rar
512 regex/\.[rR]([aA][rR]|[0-9][0-9])$
513         Open=%cd %p#urar
514         View=%view{ascii} rar v -c- %f
515         Extract=rar x -c- %f '*'
516         Extract (with flags)=I=%{Enter any RAR flags:}; if test -n "$I";then rar x $I %f; fi
518 # dbf
519 regex/\.(dbf|DBF)$
520        Open=%view{ascii} dbview %f
521        View=%view{ascii} dbview -b %f
523 # wav
524 regex/\.(wav|WAV)$
525        Open=vplay %f
526        Icon=wav.xpm
528 # wav22
529 regex/\.(wav22|WAV22)$
530        Open=vplay -s 22 %f
531        Icon=wav.xpm
533 # REXX script
534 regex/\.(rexx)|(rex)|(cmd)$
535        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
536        Icon=rexx.xpm
538 # Microsoft Word Document
539 regex/\.(doc|DOC)$
540 #       View=%view{ascii} catdoc -w %f
541        View=%view{ascii} word2x -f text %f -
542        Icon=word.xpm
543 type/Microsoft Word Document
544 #       View=%view{ascii} catdoc -w %f
545        View=%view{ascii} word2x -f text %f -
546        Icon=word.xpm
548 # cpio rules
550 shell/.cpio.Z
551         Open=%cd %d/%p#ucpio/
552         View=%view{ascii} compress -dc '%f' | cpio -ictv
553         Extract=compress -dc '%f' | cpio -ic
554         Icon=compressed.xpm
556 shell/.cpio.gz
557         Open=%cd %d/%p#ucpio/
558         View=%view{ascii} gzip -dc '%f' | cpio -ictv
559         Extract=gzip -dc '%f' | cpio -ic
560         Icon=compressed.xpm
562 shell/.cpio
563         Open=%cd %d/%p#ucpio/
564         View=%view{ascii} cat '%f' | cpio -ictv
565         Extract=cat '%f' | cpio -ic
566         Icon=cpio.xpm
568 shell/.mp3
569         Open=mpg123 %f
570         View=mpg123 %f
571         Icon=sound.xpm
573 regex/\.trpm$
574         Open=%cd trpm:%p
575         View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
577 # Default target for anything not described above
578 default/*
579         Open=
580         View=%view{ascii}
581         Drop=
582         Icon=plain.xpm
583         Title=%p