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 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
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/
50 # command is any one-line shell command, with the following substitutions:
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
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
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])$
107 View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
108 Extract=gzip -dc %f 2>/dev/null | tar xf -
113 View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
114 Extract=bzip -dc %f 2>/dev/null | tar xf -
119 View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
120 Extract=bzip2 -dc %f 2>/dev/null | tar xf -
126 View=%view{ascii} tar tvvf %f
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
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
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
149 Drop=if test ! -d ~/.trash; then mkdir ~/.trash; fi; mv -f -b -V numbered %q ~/.trash
150 Flush=rm -rf ~/.trash
154 Open=lpr %{Enter file(s) to print}
157 Print=lpr %{Enter file(s) to print}
160 Open=gzip %{Enter file to gzip}
165 Open=bzip %{Enter file to bzip}
170 Open=bzip2 %{Enter file to bzip}
175 Open=gunzip %{Enter file to gunzip}
180 Open=bunzip %{Enter file to bunzip}
185 Open=bunzip2 %{Enter file to bunzip}
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
213 regex/^ls-?lR\.(g?z|Z)$
215 View=%view{ascii} gunzip -c %f
225 Install this RPM=rpm -i %f
226 Upgrade this RPM=rpm -U %f
231 View=%view{ascii} dpkg-deb -c %f
234 regex/\.(zip|ZIP|jar|JAR)$
236 View=%view{ascii} unzip -v %f
239 Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
245 View=%view{ascii} zoo l %f
250 regex/\.(lha|LHA|lzh|LZH)$
252 View=%view{ascii} lharc l %f
254 Extract=lharc x %f '*'
255 Extract (with flags)=I=%{Enter any LHarc flags:}; if test -n "$I"; then lharc x $I %f; fi
258 regex/\.a(rj|[0-9][0-9])$
260 View=%view{ascii} unarj l %f
262 Extract=unarj x %f '*'
263 Extract (with flags)=I=%{Enter any Unarj flags:}; if test -n "$I"; then unarj x $I %f; fi
268 View=%view{ascii} nm %f
272 Open=%var{PAGER:more} %f
274 Compile=%var{CC:cc} -O -c %f
275 Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
279 Open=%var{PAGER:more} %f
282 Compile and Link=f77 -O %f
285 Open=%var{EDITOR:vi} %f
289 Open=%var{PAGER:more} %f
290 Link=%var{CC:cc} -O %f
292 Display object file symbols=%view{ascii} nm %f
293 Disassemble=%view{ascii} objdump -d -r %f
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
305 Convert file to Postscript=dvips %f
308 Open=%var{PAGER:more} %f
311 LaTeX this file=tex %f
314 Start Emacs on this RMAIL file=emacs %f
317 regex/\.(te?xi)|(texinfo)$
322 Open=%var{PAGER:more} %f
325 Link=c++ -O -o %d/`basename %f .c` %f
330 Open=%view{ascii} ar tv %f
331 View=%view{ascii} nm %f
334 # .so libraries are not manual pages
335 regex/\.so\.[0-9\.]*$
341 Open=info --directory %d -f %p
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
350 # Troff with me macros.
352 Open=nroff @TROFFASCII@ -me %f | %var{PAGER:more}
353 View=%view{ascii,nroff} nroff @TROFFASCII@ -me %f
356 # Troff with ms macros.
358 Open=nroff @TROFFASCII@ -ms %f | %var{PAGER:more}
359 View=%view{ascii,nroff} nroff @TROFFASCII@ -ms %f
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@
368 regex/(read\.?me$)|(README)
377 View with GhostView=gv %f
382 Include=image-options
387 Include=image-options
392 Include=image-options
397 Include=image-options
402 Include=image-options
407 Include=image-options
412 Include=image-options
417 Include=image-options
422 Include=image-options
427 Include=image-options
436 Include=image-options
439 include/image-options
440 Set root window to this image=background-properties --setwallpaper %f &
441 Display this file=ee %f &
447 regex/\.(wav)|(snd)|(voc)|(au)$
458 View=%view{ascii} mcmfmt < %f
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
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
476 Open=make -f %f %{Enter parameters}
491 Execute in XTerm=xterm -e %f &
492 View Required Libraries=%view{ascii} ldd %f
493 Strip binary=strip %f
499 View (big)=mpeg_play -dither 2x2 %f &
500 View (gray)=mpeg_play -dither gray %f &
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;
508 Run with AppletViewer=appletviewer %f
509 View with @X11_WWW@=@X11_WWW@ file://%f
512 regex/\.[rR]([aA][rR]|[0-9][0-9])$
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
520 Open=%view{ascii} dbview %f
521 View=%view{ascii} dbview -b %f
529 regex/\.(wav22|WAV22)$
534 regex/\.(rexx)|(rex)|(cmd)$
535 Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
538 # Microsoft Word Document
540 # View=%view{ascii} catdoc -w %f
541 View=%view{ascii} word2x -f text %f -
543 type/Microsoft Word Document
544 # View=%view{ascii} catdoc -w %f
545 View=%view{ascii} word2x -f text %f -
551 Open=%cd %d/%p#ucpio/
552 View=%view{ascii} compress -dc '%f' | cpio -ictv
553 Extract=compress -dc '%f' | cpio -ic
557 Open=%cd %d/%p#ucpio/
558 View=%view{ascii} gzip -dc '%f' | cpio -ictv
559 Extract=gzip -dc '%f' | cpio -ic
563 Open=%cd %d/%p#ucpio/
564 View=%view{ascii} cat '%f' | cpio -ictv
565 Extract=cat '%f' | cpio -ic
575 View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
577 # Default target for anything not described above