Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: None | Size: 14.49 KB | Hits: 42 | Expires: Never
Copy text to clipboard
  1. # Midnight Commander 3.0 extension file
  2. # Warning: Structure of this file has changed completely with version 3.0
  3. #
  4. # All lines starting with # or empty lines are thrown away.
  5. # Lines starting in the first column should have following format:
  6. #
  7. # keyword/descNL, i.e. everything after keyword/ until new line is desc
  8. #
  9. # keyword can be:
  10. #
  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)
  14. #
  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 ( ).
  19. #
  20. #    type  (file matches this if `file %f` matches regular expression desc
  21. #          (the filename: part from `file %f` is removed))
  22. #
  23. #    directory (matches any directory matching regular expression desc)
  24. #
  25. #    include (matches an include directive)
  26. #
  27. #    default (matches any file no matter what desc is)
  28. #
  29. # Other lines should start with a space or tab and should be in the format:
  30. #
  31. # keyword=commandNL (with no spaces around =), where keyword should be:
  32. #
  33. #    Open (if the user presses Enter or doubleclicks it),
  34. #
  35. #    View (F3), Edit (F4)
  36. #
  37. #    Include is the keyword used to add any further entries from an include/
  38. #    section
  39. #
  40. # command is any one-line shell command, with the following substitutions:
  41. #
  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)
  56. #
  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.)
  59. #
  60. #
  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.
  63. #
  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.
  71. #
  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.
  76. #
  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.
  82. #
  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
  86.  
  87.  
  88. ### Changes ###
  89. #
  90. # Reorganization: 2000-05-01 Michal Svec <rebel@penguin.cz>
  91.  
  92.  
  93. ### TODO ###
  94. #
  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)
  103. #
  104. # Maybe:        Open/XOpen/GOpen/KOpen/... for Console/X/GNOME/KDE/etc.
  105.  
  106.  
  107. ### Archives ###
  108.  
  109. # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk
  110. regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk|\.gem$
  111.         Open=%cd %p#utar
  112.         View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
  113.         Include=default
  114.  
  115. regex/\.tar\.bz$
  116.         Open=%cd %p#utar
  117.         View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
  118.         Include=default
  119.  
  120. regex/\.t(ar\.bz2|bz2?|b2)$
  121.         Open=%cd %p#utar
  122.         View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
  123.         Include=default
  124.  
  125. # .tar.lzma, .tlz
  126. regex/\.t(ar\.lzma|lz)$
  127.         Open=%cd %p#utar
  128.         View=%view{ascii} lzma -dc %f 2>/dev/null | tar tvvf -
  129.         Include=default
  130.  
  131. # .tar.xz, .txz
  132. regex/\.t(ar\.xz|xz)$
  133.         Open=%cd %p#utar
  134.         View=%view{ascii} xz -dc %f 2>/dev/null | tar tvvf -
  135.         Include=default
  136.  
  137. # .tar.F - used in QNX
  138. regex/\.tar\.F$
  139.         Open=%cd %p#utar
  140.         View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -
  141.         Include=default
  142.  
  143. # .qpr/.qpk - QNX Neutrino package installer files
  144. regex/\.(qp[rk])$
  145.         Open=%cd %p#utar
  146.         View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
  147.         Include=default
  148.  
  149. # tar
  150. regex/\.(tar|TAR)$
  151.         Open=%cd %p#utar
  152.         View=%view{ascii} tar tvvf - < %f
  153.         Include=default
  154.  
  155. # lha
  156. type/^LHa\ .*archive
  157.         Open=%cd %p#ulha
  158.         View=%view{ascii} lha l %f
  159.         Include=default
  160.  
  161. # arj
  162. regex/\.a(rj|[0-9][0-9])$
  163.         Open=%cd %p#uarj
  164.         View=%view{ascii} unarj l %f
  165.         Include=default
  166.  
  167. # cab
  168. regex/\.([cC][aA][bB])$
  169.         Open=%cd %p#ucab
  170.         View=%view{ascii} cabextract -l %f
  171.         Include=default
  172.  
  173. # ha
  174. regex/\.([Hh][Aa])$
  175.         Open=%cd %p#uha
  176.         View=%view{ascii} ha lf %f
  177.         Include=default
  178.  
  179. # rar
  180. regex/\.[rR]([aA][rR]|[0-9][0-9])$
  181.         Open=%cd %p#urar
  182.         View=%view{ascii} rar v -c- %f
  183.         Include=default
  184.  
  185. # ALZip
  186. regex/\.(alz|ALZ)$
  187.         Open=%cd %p#ualz
  188.         View=%view{ascii} unalz -l %f
  189.         Include=default
  190.  
  191. # cpio
  192. shell/.cpio.Z
  193.         Open=%cd %p#ucpio
  194.         View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null
  195.         Include=default
  196.  
  197. shell/.cpio.gz
  198.         Open=%cd %p#ucpio
  199.         View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null
  200.         Include=default
  201.  
  202. shell/.cpio
  203.         Open=%cd %p#ucpio
  204.         View=%view{ascii} cpio -itv < %f 2>/dev/null
  205.         Include=default
  206.  
  207. # ls-lR
  208. regex/(^|\.)ls-?lR(\.gz|Z|bz2)$
  209.         Open=%cd %p#lslR
  210.  
  211. # patch
  212. regex/\.(diff|patch)(\.bz2)$
  213.         Open=%cd %p#patchfs
  214.         View=%view{ascii} bzip2 -dc %f 2>/dev/null
  215.  
  216. regex/\.(diff|patch)(\.(gz|Z))$
  217.         Open=%cd %p#patchfs
  218.         View=%view{ascii} gzip -dc %f 2>/dev/null
  219.  
  220. regex/\.(diff|patch)$
  221.         Open=%cd %p#patchfs
  222.         View=%view{ascii} /bin/cat %f 2>/dev/null
  223.  
  224. # ar library
  225. regex/\.s?a$
  226.         Open=%cd %p#uar
  227.         #Open=%view{ascii} ar tv %f
  228.         View=%view{ascii} file %f && nm %f
  229.  
  230. # trpm
  231. regex/\.trpm$
  232.         Open=%cd %p#trpm
  233.         View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
  234.  
  235. # RPM packages (SuSE uses *.spm for source packages)
  236. regex/\.(src\.rpm|spm)$
  237.         Open=%cd %p#rpm
  238.         View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f
  239.  
  240. regex/\.rpm$
  241.         Open=%cd %p#rpm
  242.         View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f
  243.  
  244. # deb
  245. regex/\.u?deb$
  246.         Open=%cd %p#deb
  247.         View=%view{ascii} dpkg-deb -I %f && echo && dpkg-deb -c %f
  248.  
  249. # dpkg
  250. shell/.debd
  251.         Open=%cd %p#debd
  252.         View=%view{ascii} dpkg -s `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'`
  253. # apt
  254. shell/.deba
  255.         Open=%cd %p#deba
  256.         View=%view{ascii} apt-cache show `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'`
  257.  
  258. # ISO9660
  259. regex/\.iso$
  260.         Open=%cd %p#iso9660
  261.         View=%view{ascii} isoinfo -l -i %f
  262.         Include=default
  263.  
  264. # 7zip archives (they are not man pages)
  265. regex/\.(7z|7Z)$
  266.         Open=%cd %p#u7z
  267.         View=%view{ascii} 7za l %f 2>/dev/null
  268.         Include=default
  269.  
  270. # Mailboxes
  271. type/^ASCII\ mail\ text
  272.         Open=%cd %p#mailfs
  273.         Include=default
  274.  
  275.  
  276. ### Sources ###
  277.  
  278. # C
  279. shell/.c
  280.         Open=%var{EDITOR:vi} %f
  281.  
  282. # Fortran
  283. shell/.f
  284.         Open=%var{EDITOR:vi} %f
  285.  
  286. # Header
  287. regex/\.(h|hpp)$
  288.         Open=%var{EDITOR:vi} %f
  289.  
  290. # Object
  291. type/^ELF
  292.         #Open=%var{PAGER:more} %f
  293.         View=%view{ascii} file %f && nm %f
  294.  
  295. # Asm
  296. shell/.s
  297.         Open=%var{EDITOR:vi} %f
  298.  
  299. # C++
  300. regex/\.(C|cc|cpp)$
  301.         Open=%var{EDITOR:vi} %f
  302.  
  303.  
  304. ### Documentation ###
  305.  
  306. # Texinfo
  307. regex/\.(te?xi|texinfo)$
  308.  
  309. # GNU Info page
  310. type/^Info\ text
  311.         Open=info -f %f
  312.  
  313. shell/.info
  314.         Open=info -f %f
  315.  
  316. # Manual page
  317. # Exception - .so libraries are not manual pages
  318. regex/\.(so|so\.[0-9\.]*)$
  319.         View=%view{ascii} file %f && nm %f
  320.  
  321. regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$
  322.         Open=case %d/%f in */log/*|*/logs/*) cat %f ;; *) { zsoelim %f 2>/dev/null || cat %f; } | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
  323.         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) cat %f ;; *) { zsoelim %f 2>/dev/null || cat %f; } | nroff -c -Tlatin1 -mandoc ;; esac
  324.  
  325. # Perl pod page
  326. shell/.pod
  327.         Open=pod2man %f | nroff -c -Tlatin1 -mandoc | %var{PAGER:more}
  328.         View=%view{ascii,nroff} pod2man %f | nroff -c -Tlatin1 -mandoc
  329.  
  330. # Troff with me macros.
  331. # Exception - "read.me" is not a nroff file.
  332. shell/read.me
  333.         Open=
  334.         View=
  335.  
  336. shell/.me
  337.         Open=nroff -c -Tlatin1 -me %f | %var{PAGER:more}
  338.         View=%view{ascii,nroff} nroff -c -Tlatin1 -me %f
  339.  
  340. # Troff with ms macros.
  341. shell/.ms
  342.         Open=nroff -c -Tlatin1 -ms %f | %var{PAGER:more}
  343.         View=%view{ascii,nroff} nroff -c -Tlatin1 -ms %f
  344.  
  345. # Manual page - compressed
  346. regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$
  347.         Open=case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
  348.         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac
  349.  
  350. regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$
  351.         Open=case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
  352.         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac
  353.  
  354. regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$
  355.         Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
  356.         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff -c -Tlatin1 -mandoc ;; esac
  357.  
  358. regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$
  359.         Open=case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
  360.         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff -c -Tlatin1 -mandoc ;; esac
  361.  
  362. regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.xz$
  363.         Open=case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *) xz -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
  364.         View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *) xz -dc %f | nroff -c -Tlatin1 -mandoc ;; esac
  365.  
  366.  
  367. ### Images ###
  368.  
  369. type/^GIF
  370.         Include=image
  371.  
  372. type/^JPEG
  373.         View=%view{ascii} identify %f; test -x /usr/bin/exif && echo && exif %f 2>/dev/null
  374.         Include=image
  375.  
  376. type/^PC\ bitmap
  377.         Include=image
  378.  
  379. type/^PNG
  380.         Include=image
  381.  
  382. type/^TIFF
  383.         Include=image
  384.  
  385. type/^PBM
  386.         Include=image
  387.  
  388. type/^PGM
  389.         Include=image
  390.  
  391. type/^PPM
  392.         Include=image
  393.  
  394. type/^Netpbm
  395.         Include=image
  396.  
  397. shell/.xpm
  398.         Include=image
  399.         View=sxpm %f
  400.  
  401. shell/.ico
  402.         Include=image
  403.  
  404. include/image
  405.         View=%view{ascii} identify %f
  406.         #View=%view{ascii} asciiview %f
  407.         Include=default
  408.  
  409. ### Sound files ###
  410.  
  411. regex/\.([mM][pP]3)$
  412.         View=%view{ascii} mpg123 -vtn1 %f 2>&1 | sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
  413.         Include=default
  414.  
  415. regex/\.([oO][gG][gG|aA|vV|xX])$
  416.         View=%view{ascii} ogginfo %s
  417.         Include=default
  418.  
  419. ### Documents ###
  420.  
  421. # Postscript
  422. type/^PostScript
  423.         View=%view{ascii} ps2ascii %f
  424.         Include=default
  425.  
  426. # PDF
  427. type/^PDF
  428.         View=%view{ascii} pdftotext %f -
  429.         Include=default
  430.  
  431. # The following code very ugly and should not be taken as example.
  432. # It should be cleaned up when the new format of mc.ext is developed.
  433.  
  434. # html
  435. regex/\.([hH][tT][mM][lL]?)$
  436.         Open=(if test -n "$DISPLAY"; then (xdg-open %f &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null
  437.         View=%view{ascii} links -dump %f 2>/dev/null || w3m -dump %f 2>/dev/null || lynx -dump -force_html %f || sed 's@<\([^<>][^<>]*\)>\([^<>]*\)</\1>@\2@g' %f 2> /dev/null
  438.  
  439. # DVI
  440. regex/\.([dD][vV][iI])$
  441.         View=%view{ascii} catdvi %f
  442.         Include=default
  443.  
  444. # TeX
  445. regex/\.([Tt][Ee][Xx])$
  446.         Open=%var{EDITOR:vi} %f
  447.         Include=default
  448.  
  449. ### Miscellaneous ###
  450.  
  451. # Makefile
  452. regex/[Mm]akefile$
  453.         Open=make -f %f %{Enter parameters}
  454.  
  455. # Imakefile
  456. shell/Imakefile
  457.         Open=xmkmf -a
  458.  
  459. # Makefile.PL (MakeMaker)
  460. regex/^Makefile.(PL|pl)$
  461.         Open=%var{PERL:perl} %f
  462.  
  463. # dbf
  464. regex/\.([dD][bB][fF])$
  465.        Open=%view{ascii} dbview %f
  466.        View=%view{ascii} dbview -b %f
  467.  
  468. # REXX script
  469. regex/\.(rexx?|cmd)$
  470.        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
  471.  
  472. # Disk images for Commodore computers (VIC20, C64, C128)
  473. regex/\.(d64|D64)$
  474.         Open=%cd %p#uc1541
  475.         View=%view{ascii} c1541 %f -list
  476.         Extract=c1541 %f -extract
  477.  
  478. # Gettext Catalogs
  479. shell/.mo
  480.         View=%view{ascii} msgunfmt %f || cat %f
  481.         Include=default
  482.  
  483. # lyx
  484. regex/\.(lyx|LYX)$
  485.         View=%view{ascii} lyxcat %f
  486.         Include=default
  487.  
  488. ### Plain compressed files ###
  489.  
  490. # ace
  491. regex/\.(ace|ACE)$
  492.         Open=%cd %p#uace
  493.         View=%view{ascii} unace l %f
  494.         Extract=unace x %f
  495.         Include=default
  496.  
  497. # arc
  498. regex/\.(arc|ARC)$
  499.         Open=%cd %p#uarc
  500.         View=%view{ascii} arc l %f
  501.         Extract=arc x %f '*'
  502.         Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi
  503.         Include=default
  504.  
  505. # zip
  506. type/^([Zz][Ii][Pp])\ archive
  507.         Open=%cd %p#uzip
  508.         View=%view{ascii} unzip -v %f
  509.         Include=default
  510.  
  511. # zoo
  512. regex/\.([Zz][Oo][Oo])$
  513.         Open=%cd %p#uzoo
  514.         View=%view{ascii} zoo l %f
  515.         Include=default
  516.  
  517. # gzip
  518. type/^gzip
  519.         Open=gzip -dc %f | %var{PAGER:more}
  520.         View=%view{ascii} gzip -dc %f 2>/dev/null
  521.         Include=default
  522.  
  523. regex/\.(gz|Z)?$
  524.         View=%view{ascii} gzip -dc %f 2>/dev/null
  525.         Include=default
  526.  
  527. # bzip2
  528. type/^bzip2
  529.         Open=bzip2 -dc %f | %var{PAGER:more}
  530.         View=%view{ascii} bzip2 -dc %f 2>/dev/null
  531.         Include=default
  532.  
  533. regex/\.bz2?$
  534.         View=%view{ascii} bzip2 -dc %f 2>/dev/null
  535.         Include=default
  536.  
  537. # bzip
  538. type/^bzip
  539.         Open=bzip -dc %f | %var{PAGER:more}
  540.         View=%view{ascii} bzip -dc %f 2>/dev/null
  541.         Include=default
  542.  
  543. # compress
  544. type/^compress
  545.         Open=gzip -dc %f | %var{PAGER:more}
  546.         View=%view{ascii} gzip -dc %f 2>/dev/null
  547.         Include=default
  548.  
  549. # lzma
  550. regex/\.lzma$
  551.         Open=lzma -dc %f | %var{PAGER:more}
  552.         View=%view{ascii} lzma -dc %f 2>/dev/null
  553.         Include=default
  554.  
  555. # xz
  556. regex/\.xz$
  557.         Open=xz -dc %f | %var{PAGER:more}
  558.         View=%view{ascii} xz -dc %f 2>/dev/null
  559.         Include=default
  560.  
  561. type/.* executable.*
  562.         Open=
  563.         View=
  564.  
  565. directory/.*
  566.         Open=
  567.         View=
  568.         Include=default
  569.  
  570. ### Default ###
  571.  
  572. include/default
  573.         Open=xdg-open %f 1> /dev/null 2> /dev/null
  574.         View=xdg-open %f 1> /dev/null 2> /dev/null
  575.         Edit=xdg-open %f 1> /dev/null 2> /dev/null
  576.  
  577. default/*
  578.         Open=xdg-open %f 1> /dev/null 2> /dev/null
  579.         View=
  580.         Edit=
  581.  
  582. ### EOF ###