Ticket #3742: mc.ext.txt

File mc.ext.txt, 4.6 KB (added by mc-hobbit, 3 years ago)

Proposed update to mc.ext comments

Line 
1# Midnight Commander extension file
2#
3# Empty lines and lines starting with "#" are ignored.
4#
5# Lines starting in the first column should have following format:
6#
7#   KEYWORD/DESC<NL> (i.e. everything after "KEYWORD/" until newline is "DESC")
8#
9# KEYWORD is one of the following:
10#
11#    shell
12#       DESC is, when starting with a dot, an extension (no wildcards.)
13#       All the files matching '*DESC'. Example: .tar matches *.tar; if it
14#       doesn't start with a dot, it matches only a file of that name.
15#
16#    shell/i
17#       DESC is, when starting with a dot, an extension (no wildcards.)
18#       The same as "shell" but case-insensitive.
19#
20#    regex
21#       DESC is an extended regular expression.
22#       Note that mc uses the GNU regex library and thus:
23#         \| matches the literal | and | has special meaning ("or")
24#         () have special meaning and \( \) stand for literal ( )
25#
26#    regex/i
27#       DESC is an extended regular expression.
28#       The same as "regex" but case-insensitive.
29#
30#    type
31#       File matches this if `file %f` matches regular expression DESC
32#       (the 'filename:' text from `file %f` is removed)
33#
34#    type/i
35#       File matches this if `file %f` matches regular expression DESC
36#       The same as "type" but case-insensitive.
37#
38#    directory
39#       Matches any directory matching regular expression DESC
40#
41#    include
42#       Matches an 'include' directive
43#
44#    default
45#       Matches any file regardless of the value of DESC
46#
47# Other lines should start with a space or tab and should be in the format:
48#
49#   KEYWORD=COMMAND<NL> (with no spaces around =)
50#
51# KEYWORD is one of the # following:
52#
53#    Open
54#       COMMAND is run if the user presses Enter or double-clicks the file
55#
56#    View
57#       COMMAND is run if the user presses F3
58#
59#    Edit
60#       COMMAND is run if the user presses F4
61#
62#    Include
63#       Add any further entries from an 'include/' section
64#
65# COMMAND is any one-line shell command, with the following substitutions:
66#
67#    %%
68#       The '%' character
69#
70#    %p or $MC_EXT_BASENAME
71#       Name of the current file (without path, but 'pwd' is its path.)
72#
73#    %f or $MC_EXT_FILENAME
74#       Name of the current file. Unlike %p, if file is located on a non-local
75#       virtual filesystem (e.g. tarfs or ftpfs,) then the file will be
76#       temporarily copied into a local directory and %f will be the full path
77#       to this local temporal file.  If you don't want to get a local copy and
78#       want to get the virtual fs path (like ftp://ftp.cvut.cz/pub/linux),
79#       then use %d/%p instead of %f.
80#
81#    %d or $MC_EXT_CURRENTDIR
82#       Name of the current directory (pwd, without trailing slash)
83#
84#    %s or $MC_EXT_SELECTED
85#       Space separated list of tagged files (if any) or the name of the
86#       current file.
87#
88#    %t or $MC_EXT_ONLYTAGGED
89#       Space-spearted list of tagged files
90#
91#    %u
92#       list of tagged files; untagged after command completes
93#
94#    (If the above six letters are in uppercase, they refer to the other panel.
95#    But you shouldn't have to use it in this file.)
96#
97#    %cd PATH
98#       PATH that mc should change into ("cd" won't work because it's a child
99#       process.)  %cd handles even vfs names.
100#
101#    %view
102#       Output from COMMAND will be piped into mc's internal file viewer.  If
103#       you type only '%view' and no COMMAND, viewer will directly load the %f
104#       file without piping. The result is the same as if COMMAND was "%view
105#       cat %f," but without the need to fork a shell, run 'cat', and read its
106#       output.
107#
108#       %view may be directly followed by {} with a list of any of the following
109#       separated by commas:
110#         ascii  (ascii mode)
111#         hex    (hex mode)
112#         nroff  (colour highlighting for text using backspace for bold and underscore)
113#         unform (no highlighting for nroff sequences) separated by commas.
114#
115#    %var{VARNAME:default}
116#       Expands to the value of the VARNAME variable in the environment if it's
117#       set, otherwise the value in "default" is used. This is similar to the
118#       Bourne shell ${VAR-default} construct.
119#
120# Rules are applied from top to bottom, thus the order is important.  If some
121# actions are missing, search continues as if this target didn't match (i.e. if
122# a file matches the first and second entry and View action is missing in the
123# first one, then on pressing F3 the View action from the second entry will be
124# used. default should catch all the actions.
125#
126# Any new entries you develop for you are always welcome if they are useful
127# on more than one system.  You can post your modifications as tickets at
128# www.midnight-commander.org