.mc/bindings.cygwin
changeset 87 63b568f99e3c
parent 18 2e991b769c95
equal deleted inserted replaced
86:1e9048a10b95 87:63b568f99e3c
       
     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 ### Archives ###
       
    89 
       
    90 # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk
       
    91 regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$
       
    92 	Open=%cd %p#utar
       
    93 	View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
       
    94 
       
    95 regex/\.tar\.bz$
       
    96 	# Open=%cd %p#utar
       
    97 	View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
       
    98 
       
    99 regex/\.t(ar\.bz2|bz|b2)$
       
   100 	Open=%cd %p#utar
       
   101 	View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
       
   102 
       
   103 # .tar.F - used in QNX
       
   104 regex/\.tar\.F$
       
   105 	# Open=%cd %p#utar
       
   106 	View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -
       
   107 
       
   108 # .qpr/.qpk - QNX Neutrino package installer files
       
   109 regex/\.(qp[rk])$
       
   110 	Open=%cd %p#utar
       
   111 	View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
       
   112 
       
   113 # tar
       
   114 regex/\.(tar|TAR)$
       
   115 	Open=%cd %p#utar
       
   116 	View=%view{ascii} tar tvvf - < %f
       
   117 
       
   118 # lha
       
   119 type/^LHa\ .*archive
       
   120 	Open=%cd %p#ulha
       
   121 	View=%view{ascii} lha l %f
       
   122 
       
   123 # arj
       
   124 regex/\.a(rj|[0-9][0-9])$
       
   125 	Open=%cd %p#uarj
       
   126 	View=%view{ascii} arj l %f
       
   127 
       
   128 # ha
       
   129 regex/\.([Hh][Aa])$
       
   130 	Open=%cd %p#uha
       
   131 	View=%view{ascii} ha lf %f
       
   132 
       
   133 # rar
       
   134 regex/\.[rR]([aA][rR]|[0-9][0-9])$
       
   135 	Open=%cd %p#urar
       
   136 	View=%view{ascii} rar v -c- %f
       
   137 
       
   138 # cpio
       
   139 shell/.cpio.Z
       
   140 	Open=%cd %p#ucpio
       
   141 	View=%view{ascii} gzip -dc '%f' | cpio -itv 2>/dev/null
       
   142 
       
   143 shell/.cpio.gz
       
   144 	Open=%cd %p#ucpio
       
   145 	View=%view{ascii} gzip -dc '%f' | cpio -itv 2>/dev/null
       
   146 
       
   147 shell/.cpio
       
   148 	Open=%cd %p#ucpio
       
   149 	View=%view{ascii} cpio -itv <'%f' 2>/dev/null
       
   150 
       
   151 # ls-lR
       
   152 regex/(^|\.)ls-?lR(\.g?z|Z|bz2)?$
       
   153 	Open=%cd %p#lslR
       
   154 
       
   155 # patch
       
   156 regex/\.(diff|patch)(\.(bz2|gz|Z))?$
       
   157         Open=%cd %p#patchfs
       
   158 
       
   159 # ar library
       
   160 regex/\.s?a$
       
   161 	Open=%cd %p#uar
       
   162 	#Open=%view{ascii} ar tv %f
       
   163 	View=%view{ascii} file %f && nm %f
       
   164 
       
   165 # trpm
       
   166 regex/\.trpm$
       
   167 	Open=%cd %p#trpm
       
   168 	View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
       
   169 
       
   170 # RPM packages (SuSE uses *.spm for source packages)
       
   171 regex/\.(rpm|spm)$
       
   172 	Open=%cd %p#rpm
       
   173 	View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f
       
   174 
       
   175 # deb
       
   176 regex/\.u?deb$
       
   177 	Open=%cd %p#deb
       
   178 	View=%view{ascii} dpkg-deb -I %f && echo && dpkg-deb -c %f
       
   179 
       
   180 # dpkg
       
   181 shell/.debd
       
   182         Open=%cd %p#debd
       
   183         View=%view{ascii} dpkg -s `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'`
       
   184 # apt
       
   185 shell/.deba
       
   186         Open=%cd %p#deba
       
   187         View=%view{ascii} apt-cache show `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'`
       
   188 
       
   189 # ISO9660
       
   190 regex/\.iso$
       
   191 	Open=%cd %p#iso9660
       
   192 	View=%view{ascii} isoinfo -l -i %f
       
   193 
       
   194 # 7zip archives (they are not man pages)
       
   195 shell/.7z
       
   196 	View=%view{ascii} 7za l %f 2>/dev/null
       
   197 
       
   198 
       
   199 ### Documentation ###
       
   200 
       
   201 # Texinfo
       
   202 regex/\.(te?xi|texinfo)$
       
   203 
       
   204 # GNU Info page
       
   205 type/^Info\ text
       
   206 	Open=info -f %f
       
   207 
       
   208 shell/.info
       
   209 	Open=info -f %f
       
   210 
       
   211 # Manual page
       
   212 # Exception - .so libraries are not manual pages
       
   213 regex/\.(so|so\.[0-9\.]*)$
       
   214 	View=%view{ascii} file %f && nm %f
       
   215 
       
   216 regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$
       
   217 	Open=case %d/%f in */log/*|*/logs/*) cat %f ;; *) nroff  -man %f ;; esac | sensible-pager
       
   218 	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) cat %f ;; *) nroff  -man %f ;; esac
       
   219 
       
   220 # Troff with me macros.
       
   221 # Exception - "read.me" is not a nroff file.
       
   222 shell/read.me
       
   223 	Open=
       
   224 	View=
       
   225 
       
   226 shell/.me
       
   227 	Open=nroff  -me %f | sensible-pager
       
   228 	View=%view{ascii,nroff} nroff  -me %f
       
   229 
       
   230 # Troff with ms macros.
       
   231 shell/.ms
       
   232 	Open=nroff  -ms %f | sensible-pager
       
   233 	View=%view{ascii,nroff} nroff  -ms %f
       
   234 
       
   235 # Manual page - compressed
       
   236 regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$
       
   237 	Open=case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff  -man ;; esac | sensible-pager
       
   238 	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff  -man ;; esac
       
   239 
       
   240 regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$
       
   241 	Open=case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff  -man ;; esac | sensible-pager
       
   242 	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff  -man ;; esac
       
   243 
       
   244 regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$
       
   245 	Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff  -man ;; esac | sensible-pager
       
   246 	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff  -man ;; esac
       
   247 
       
   248 ### Miscellaneous ###
       
   249 
       
   250 # Makefile
       
   251 regex/[Mm]akefile$
       
   252 	Open=make -f %f %{Enter parameters}
       
   253 
       
   254 # Imakefile
       
   255 shell/Imakefile
       
   256 	Open=xmkmf -a
       
   257 
       
   258 # Makefile.PL (MakeMaker)
       
   259 regex/^Makefile.(PL|pl)$
       
   260 	Open=%var{PERL:perl} %f
       
   261 
       
   262 # dbf
       
   263 regex/\.([dD][bB][fF])$
       
   264        Open=%view{ascii} dbview %f
       
   265        View=%view{ascii} dbview -b %f
       
   266 
       
   267 # REXX script
       
   268 regex/\.(rexx?|cmd)$
       
   269        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
       
   270 
       
   271 
       
   272 ### Plain compressed files ###
       
   273 
       
   274 # zip
       
   275 type/^([Zz][Ii][Pp])\ archive
       
   276 	Open=%cd %p#uzip
       
   277 	View=%view{ascii} unzip -v %f
       
   278 
       
   279 # zoo
       
   280 regex/\.([Zz][Oo][Oo])$
       
   281 	Open=%cd %p#uzoo
       
   282 	View=%view{ascii} zoo l %f
       
   283 
       
   284 # gzip
       
   285 type/^gzip
       
   286 	Open=gzip -dc %f | sensible-pager
       
   287 	View=%view{ascii} gzip -dc %f 2>/dev/null
       
   288 
       
   289 # bzip2
       
   290 type/^bzip2
       
   291 	Open=bzip2 -dc %f | sensible-pager
       
   292 	View=%view{ascii} bzip2 -dc %f 2>/dev/null
       
   293 
       
   294 # bzip
       
   295 type/^bzip
       
   296 	Open=bzip -dc %f | sensible-pager
       
   297 	View=%view{ascii} bzip -dc %f 2>/dev/null
       
   298 
       
   299 # compress
       
   300 type/^compress
       
   301 	Open=gzip -dc %f | sensible-pager
       
   302 	View=%view{ascii} gzip -dc %f 2>/dev/null
       
   303 
       
   304 ### Debian additions ###
       
   305 
       
   306 # Gettext Catalogs
       
   307 shell/.mo
       
   308 	View=%view{ascii} msgunfmt %f || cat %f
       
   309 
       
   310 ### My. ###
       
   311 
       
   312 shell/.my
       
   313     Open=echo %f %{Enter opt:} %{Enter file:}
       
   314 
       
   315 ### Default ###
       
   316 
       
   317 # Default target for anything not described above.
       
   318 default/*
       
   319 	Open=cygstart %f&
       
   320 	View=
       
   321 
       
   322 ### EOF ###