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