]> git.phdru.name Git - extfs.d.git/blob - INSTALL.txt
Extend installation instructions
[extfs.d.git] / INSTALL.txt
1 How to install an external VFS script
2 =====================================
3
4 Related to extfs installation there are two major versions of Midnight
5 Commander. Older versions before 4.7.something use extfs.ini
6 configuration file. Newer versions simply allow to drop a VFS script to
7 ~/.mc/extfs.d directory. One can distinguish these versions by looking
8 up the file extfs.ini; run the following command from the command line:
9
10 locate -b \\extfs.ini
11
12 (I use GNU locate conventions; adapt the command line to your system;
13 the simplest variant is just "locate extfs.ini".)
14
15 Usual places for extfs.ini are /etc/mc/extfs/extfs.ini,
16 /usr/lib/mc/extfs/extfs.ini, /usr/share/mc/extfs/extfs.ini or
17 /usr/local/share/mc/extfs/extfs.ini.
18
19 Older versions - extfs.ini
20 --------------------------
21
22 On the system where there is a file extfs.ini a VFS script has to be
23 installed the following way. Put the script into the system extfs
24 directory - /usr/share/mc/extfs/ or /usr/local/share/mc/extfs/. Make the
25 script executable. Edit extfs.ini - add a line naming the script; for
26 example, if one's installing xml VFS one has to do something like
27
28 cd /etc/mc/extfs
29 echo xml >>extfs.ini
30
31 To use the installed VFS one also has to edit ~/.mc/mc.ext to assign the
32 VFS to file extension(s) or type(s). For example to assign xml VFS to
33 *.xml files (ignore case) and to XML file type add the following to
34 mc.ext:
35
36 regex/\.([xX][mM][lL])$
37     Open=%cd %p#xml
38
39 type/^XML *(1\.0 *)?document text
40     Open=%cd %p#xml
41
42 To enable file types add or change the following configuration option in
43 ini file in section [Midnight-Commander]:
44
45 use_file_to_guess_type=1
46
47 This has to be done using text editor - mc doesn't allow editing the
48 option in its configuration editor.
49
50 Newer versions ~/.mc/extfs.d
51 ----------------------------
52
53 For newer versions just drop a VFS script to ~/.mc/extfs.d or
54 ~/.local/share/mc/extfs.d/ directory (verify directory by running "mc -F").
55 Make the script executable. Edit mc.ext; the syntax is slightly
56 different:
57
58 regex/\.([xX][mM][lL])$
59     Include=xml
60
61 type/^XML *(1\.0 *)?document text
62     Include=xml
63
64 include/xml
65     Open=%cd %p/xml://
66
67 Enable file types guessing (see above).