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 # Title is the default icon title for objects. %p is expanded into the
41 # name of that file and %d/%p to a name with full path. Default title
42 # (if none is specified) is %p
44 # Include is the keyword used to add any further entries from an include/
47 # command is any one-line shell command, with the following substitutions:
50 # %p -> name of the current file (without path, but pwd is its path)
51 # %f -> name of the current file. Unlike %p, if file is located on a
52 # non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
53 # then the file will be temporarily copied into a local directory
54 # and %f will be the full path to this local temporal file.
55 # If you don't want to get a local copy and want to get the
56 # virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
57 # use %d/%p instead of %f.
58 # %d -> name of the current directory (pwd, without trailing slash)
59 # %s -> "selected files", i.e. space separated list of tagged files if any
60 # or name of the current file
61 # %t -> list of tagged files
62 # %u -> list of tagged files (they'll be untaged after the command)
64 # (If these 6 letters are in uppercase, they refer to the other panel.
65 # But you shouldn't have to use it in this file.)
68 # %cd -> the rest is not command, but a path which will mc cd internally
69 # into (cd wouldn't work, since it is a child process, and %cd handles
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 (c\bc color highlighting)
77 # and unformatted (not highlighting nroff sequences) separated by
80 # %var -> You use it like this: %var{ENV-VAR:default}. This macro will expand
81 # to the value of the ENV-VAR variable in the environement if it is set
82 # otherwise the value in default will be used. This is similar to
83 # the Bourne shell ${VAR-def} construct. We use it so that the extension
84 # file could be used unchanged under some shells that may use different
85 # methods of doing this
87 # %q -> will be replaced with a list of files user dropped on it
88 # with full pathnames (only applicable in the Drop command).
90 # Target are evaluted from top to bottom (order is thus important).
91 # If some actions are missing, search continues as if this target didn't
92 # match (i.e. if a file matches the first and second entry and View action
93 # is missing in the first one, then on pressing F3 the View action from
94 # the second entry will be used. default should catch all the actions.
96 # Any handy entries you develop for you are always welcome, if it has
97 # wider usage than on one system. You can send your modifications to
98 # via email to mc-devel@roxanne.nuclecu.unam.mx
100 # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
102 regex/\.t([gp]?z|ar\.g?[zZ])$
104 View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
105 Extract=gzip -dc %f 2>/dev/null | tar xf -
109 View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
110 Extract=bzip -dc %f 2>/dev/null | tar xf -
114 View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
115 Extract=bzip2 -dc %f 2>/dev/null | tar xf -
120 View=%view{ascii} tar tvvf %f
125 Open=bzip -dc %f | %var{PAGER:more}
126 View=%view{ascii} bzip -dc %f 2>/dev/null
130 Open=bzip2 -dc %f | %var{PAGER:more}
131 View=%view{ascii} bzip2 -dc %f 2>/dev/null
132 Uncompress=bunzip2 %f
136 Start XTerm here=cd %p; exec xterm &
137 Make tar.gz=I=%{Enter destination file name:}; if test -n "$I"; then tar cvf - %p | gzip > $I; fi
144 regex/^ls-?lR\.(g?z|Z)$
146 View=%view{ascii} gunzip -c %f
155 Install this RPM=rpm -i %f
156 Upgrade this RPM=rpm -U %f
161 View=%view{ascii} dpkg-deb -c %f
164 regex/\.(zip|ZIP|jar|JAR)$
166 View=%view{ascii} unzip -v %f
168 Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
174 View=%view{ascii} zoo l %f
178 regex/\.(lha|LHA|lzh|LZH)$
180 View=%view{ascii} lharc l %f
181 Extract=lharc x %f '*'
182 Extract (with flags)=I=%{Enter any LHarc flags:}; if test -n "$I"; then lharc x $I %f; fi
185 regex/\.a(rj|[0-9][0-9])$
187 View=%view{ascii} unarj l %f
188 Extract=unarj x %f '*'
189 Extract (with flags)=I=%{Enter any Unarj flags:}; if test -n "$I"; then unarj x $I %f; fi
194 View=%view{ascii} nm %f
200 Compile=%var{CC:cc} -O -c %f
201 Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
207 Compile and Link=f77 -O %f
214 Link=%var{CC:cc} -O %f
215 Display object file symbols=%view{ascii} nm %f
216 Disassemble=%view{ascii} objdump -d -r %f
220 Assemble=%var{CC:cc} -O -c %f
221 Link=%var{CC:cc} -O -o %d/`basename %f .s` %f
226 Convert file to Postscript=dvips %f
231 LaTeX this file=tex %f
234 Start Emacs on this RMAIL file=emacs %f
242 Link=c++ -O -o %d/`basename %f .c` %f
246 Open=%view{ascii} ar tv %f
247 View=%view{ascii} nm %f
249 # .so libraries are not manual pages
250 regex/\.so\.[0-9\.]*$
254 regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
256 View=%view{ascii,nroff} nroff @TROFFASCII@ @MANDOC@ %f
258 # Troff with me macros.
261 View=%view{ascii,nroff} nroff @TROFFASCII@ -me %f
263 # Troff with ms macros.
266 View=%view{ascii,nroff} nroff @TROFFASCII@ -ms %f
268 # Manual page - compressed
269 regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
270 Open=%view{ascii,nroff} gunzip -dc %f | nroff @TROFFASCII@ @MANDOC@
271 View=%view{ascii,nroff} gunzip -dc %f | nroff @TROFFASCII@ @MANDOC@
275 View with GhostView=gv %f
279 Include=image-options
283 Include=image-options
287 Include=image-options
291 Include=image-options
295 Include=image-options
299 Include=image-options
303 Include=image-options
307 Include=image-options
311 Include=image-options
315 Include=image-options
323 Include=image-options
325 include/image-options
326 Set root window to this image=background-properties --setwallpaper %f &
327 Display this file=ee %f &
333 regex/\.(wav)|(snd)|(voc)|(au)$
341 View=%view{ascii} mcmfmt < %f
345 Open=%view{ascii} gzip -dc %f 2>/dev/null
346 View=%view{ascii} gzip -dc %f 2>/dev/null
347 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
351 Open=%view{ascii} gzip -dc %f 2>/dev/null
352 View=%view{ascii} gzip -dc %f 2>/dev/null
353 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
357 Open=make -f %f %{Enter parameters}
370 Execute in XTerm=xterm -e %f &
371 View Required Libraries=%view{ascii} ldd %f
372 Strip binary=strip %f
377 View (big)=mpeg_play -dither 2x2 %f &
378 View (gray)=mpeg_play -dither gray %f &
382 # Open=if echo "%d/%p" | grep ^ftp; then $viewer %d/%p; else $viewer file:%p; fi
383 Open=gnome-moz-remote %f
384 View=%view{ascii} lynx -dump -force_html %f;
385 Run with AppletViewer=appletviewer %f
386 View with @X11_WWW@=@X11_WWW@ file://%f
389 regex/\.[rR]([aA][rR]|[0-9][0-9])$
391 View=%view{ascii} rar v -c- %f
392 Extract=rar x -c- %f '*'
393 Extract (with flags)=I=%{Enter any RAR flags:}; if test -n "$I";then rar x $I %f; fi
397 Open=%view{ascii} dbview %f
398 View=%view{ascii} dbview -b %f
405 regex/\.(wav22|WAV22)$
409 regex/\.(rexx)|(rex)|(cmd)$
410 Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
412 # Microsoft Word Document
414 # View=%view{ascii} catdoc -w %f
415 View=%view{ascii} word2x -f text %f -
416 type/Microsoft Word Document
417 # View=%view{ascii} catdoc -w %f
418 View=%view{ascii} word2x -f text %f -
423 Open=%cd %d/%p#ucpio/
424 View=%view{ascii} compress -dc '%f' | cpio -ictv
425 Extract=compress -dc '%f' | cpio -ic
428 Open=%cd %d/%p#ucpio/
429 View=%view{ascii} gzip -dc '%f' | cpio -ictv
430 Extract=gzip -dc '%f' | cpio -ic
433 Open=%cd %d/%p#ucpio/
434 View=%view{ascii} cat '%f' | cpio -ictv
435 Extract=cat '%f' | cpio -ic
441 # Default target for anything not described above