1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY vim-download-http "http://ftp.at.vim.org/pub/vim/unix/vim-&vim-version;.tar.bz2">
|
---|
8 | <!ENTITY vim-download-ftp "ftp://ftp.vim.org/pub/vim/unix/vim-&vim-version;.tar.bz2">
|
---|
9 | <!ENTITY vim-md5sum "44c6b4914f38d6f9aa959640b89da329">
|
---|
10 | <!ENTITY vim-size "6.6 MB">
|
---|
11 | <!ENTITY vim-buildsize "75 MB">
|
---|
12 | <!ENTITY vim-time "0.8 SBU">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="vim" xreflabel="Vim-&vim-version;">
|
---|
16 | <?dbhtml filename="vim.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <othername>$LastChangedBy$</othername>
|
---|
20 | <date>$Date$</date>
|
---|
21 | </sect1info>
|
---|
22 |
|
---|
23 | <title>Vim-&vim-version;</title>
|
---|
24 |
|
---|
25 | <indexterm zone="vim">
|
---|
26 | <primary sortas="a-Vim">Vim</primary>
|
---|
27 | </indexterm>
|
---|
28 |
|
---|
29 | <sect2 role="package">
|
---|
30 | <title>Introduction to Vim</title>
|
---|
31 |
|
---|
32 | <para>The <application>Vim</application> package, which is an
|
---|
33 | abbreviation for VI IMproved, contains a <command>vi</command>
|
---|
34 | clone with extra features as compared to the original
|
---|
35 | <command>vi</command>.</para>
|
---|
36 |
|
---|
37 | <para>The default LFS instructions install <application>vim</application>
|
---|
38 | as a part of the base system. If you would prefer to link
|
---|
39 | <application>vim</application> against <application>X</application>,
|
---|
40 | you should recompile <application>vim</application> to enable GUI mode.
|
---|
41 | There is no need for special instructions since
|
---|
42 | <application>X</application> support is automatically detected.</para>
|
---|
43 |
|
---|
44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
45 | <itemizedlist spacing="compact">
|
---|
46 | <listitem>
|
---|
47 | <para>Download (HTTP): <ulink url="&vim-download-http;"/></para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>Download (FTP): <ulink url="&vim-download-ftp;"/></para>
|
---|
51 | </listitem>
|
---|
52 | <listitem>
|
---|
53 | <para>Download MD5 sum: &vim-md5sum;</para>
|
---|
54 | </listitem>
|
---|
55 | <listitem>
|
---|
56 | <para>Download size: &vim-size;</para>
|
---|
57 | </listitem>
|
---|
58 | <listitem>
|
---|
59 | <para>Estimated disk space required: &vim-buildsize;</para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>Estimated build time: &vim-time;</para>
|
---|
63 | </listitem>
|
---|
64 | </itemizedlist>
|
---|
65 |
|
---|
66 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
67 | <itemizedlist spacing='compact'>
|
---|
68 | <listitem>
|
---|
69 | <para>Recommended Patch: <ulink
|
---|
70 | url="&patch-root;/vim-&vim-version;-mandir-1.patch"/></para>
|
---|
71 | </listitem>
|
---|
72 | <listitem>
|
---|
73 | <para>Translated Vim messages: <ulink
|
---|
74 | url="http://ftp.at.vim.org/pub/vim/extra/vim-&vim-version;-lang.tar.gz"/>
|
---|
75 | </para>
|
---|
76 | </listitem>
|
---|
77 | </itemizedlist>
|
---|
78 |
|
---|
79 | <bridgehead renderas="sect3">Vim Dependencies</bridgehead>
|
---|
80 |
|
---|
81 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
82 | <para role="recommended"><xref linkend="x-window-system"/></para>
|
---|
83 |
|
---|
84 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
85 | <para role="optional"><xref linkend="gtk2"/> OR
|
---|
86 | <xref linkend="lesstif"/> OR
|
---|
87 | <xref linkend="GTK"/>,
|
---|
88 | <xref linkend="python"/>,
|
---|
89 | <xref linkend="tcl"/>,
|
---|
90 | <xref linkend="ruby"/>, and
|
---|
91 | <xref linkend="gpm"/></para>
|
---|
92 |
|
---|
93 | <para condition="html" role="usernotes">User Notes:
|
---|
94 | <ulink url="&blfs-wiki;/vim"/></para>
|
---|
95 |
|
---|
96 | </sect2>
|
---|
97 |
|
---|
98 | <sect2 role="installation">
|
---|
99 | <title>Installation of Vim</title>
|
---|
100 |
|
---|
101 | <note>
|
---|
102 | <para>If you recompile <application>Vim</application> to link against
|
---|
103 | <application>X</application>, and your <application>X</application>
|
---|
104 | libraries are not on the root partition, you will no longer have an editor
|
---|
105 | for use in emergencies. You may choose to install an additional editor,
|
---|
106 | not link <application>Vim</application> against
|
---|
107 | <application>X</application>, or move the current <command>vim</command>
|
---|
108 | executable to the <filename class="directory">/bin</filename> directory
|
---|
109 | under a different name such as <filename>vi</filename>.</para>
|
---|
110 | </note>
|
---|
111 |
|
---|
112 | <para>If desired, unpack the translated messages archive:</para>
|
---|
113 |
|
---|
114 | <screen><userinput>tar -xf ../vim-&vim-version;-lang.tar.gz --strip-components=1</userinput></screen>
|
---|
115 |
|
---|
116 | <para>Install <application>Vim</application> by running the following
|
---|
117 | commands:</para>
|
---|
118 |
|
---|
119 | <screen><userinput>patch -Np1 -i ../vim-&vim-version;-mandir-1.patch &&
|
---|
120 | echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
|
---|
121 | echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
|
---|
122 | ./configure --prefix=/usr --with-features=huge &&
|
---|
123 | make</userinput></screen>
|
---|
124 |
|
---|
125 | <para>To test the results, issue: <command>make test</command>.
|
---|
126 | The <application>vim</application> test suite outputs a lot of binary
|
---|
127 | data to the screen, which can cause issues with the settings of the
|
---|
128 | current terminal. This can be resolved by redirecting the output to a
|
---|
129 | log file. Even if one of the tests fails to produce the file
|
---|
130 | <filename>test.out</filename> in <filename
|
---|
131 | class="directory">src/testdir</filename>, the remaining tests will still
|
---|
132 | be executed. If all goes well,the final message in the log file will be
|
---|
133 | <literal>ALL DONE</literal>. <emphasis>Note</emphasis>: Some color tests
|
---|
134 | expect to be executed under the <command>xterm</command> terminal
|
---|
135 | emulator.</para>
|
---|
136 |
|
---|
137 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
138 |
|
---|
139 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
140 |
|
---|
141 | <para>By default, Vim's documentation is installed in <filename
|
---|
142 | class="directory">/usr/share/vim</filename>. The following symlink allows
|
---|
143 | the documentation to be accessed via <filename
|
---|
144 | class="directory">/usr/share/doc/vim-&vim-version;</filename>, making it consistent
|
---|
145 | with the location of documentation for other packages:</para>
|
---|
146 |
|
---|
147 |
|
---|
148 | <!-- When updating, be sure to change the line below for the proper 'vimxx' unpacked
|
---|
149 | directory -->
|
---|
150 |
|
---|
151 | <screen role="root"><userinput>ln -snfv ../vim/vim71/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
|
---|
152 |
|
---|
153 | </sect2>
|
---|
154 |
|
---|
155 | <sect2 role="commands">
|
---|
156 | <title>Command Explanations</title>
|
---|
157 |
|
---|
158 | <para><command>patch …</command>: These patches are the same as LFS
|
---|
159 | and update the package with upstream patches and ensure the man pages
|
---|
160 | are placed in the proper locations.</para>
|
---|
161 |
|
---|
162 | <para><parameter>--with-features=huge</parameter>: This switch enables all
|
---|
163 | the additional features available in <application>Vim</application>.</para>
|
---|
164 |
|
---|
165 | <para><option>--enable-gui=no</option>: This will prevent compilation of the
|
---|
166 | GUI. <application>Vim</application> will still link against
|
---|
167 | <application>X</application> so that some nice eye-candy such as updating the
|
---|
168 | title bar of an <application>Xterm</application> window are available.</para>
|
---|
169 |
|
---|
170 | <para><option>--without-x</option>: If you prefer not to link
|
---|
171 | <application>Vim</application> against <application>X</application>, use
|
---|
172 | this switch.</para>
|
---|
173 |
|
---|
174 | <para><option>--enable-perlinterp</option>, <option>--enable-pythoninterp</option>,
|
---|
175 | <option>--enable-tclinterp</option>, <option>--enable-rubyinterp</option>:
|
---|
176 | These options include the Perl, Python, Tcl, or Ruby interpreters that allow
|
---|
177 | using other application code in <application>vim</application> scripts.</para>
|
---|
178 |
|
---|
179 | </sect2>
|
---|
180 |
|
---|
181 | <sect2 role="configuration">
|
---|
182 | <title>Configuring Vim</title>
|
---|
183 |
|
---|
184 | <sect3 id='vim-config'>
|
---|
185 | <title>Config Files</title>
|
---|
186 |
|
---|
187 | <para><filename>/etc/vimrc</filename> and
|
---|
188 | <filename>~/.vimrc</filename></para>
|
---|
189 |
|
---|
190 | <indexterm zone="vim vim-config">
|
---|
191 | <primary sortas="e-etc-vimrc">/etc/vimrc</primary>
|
---|
192 | </indexterm>
|
---|
193 |
|
---|
194 | <indexterm zone="vim vim-config">
|
---|
195 | <primary sortas="e-AA.vimrc">~/.vimrc</primary>
|
---|
196 | </indexterm>
|
---|
197 |
|
---|
198 | </sect3>
|
---|
199 |
|
---|
200 | <sect3 id='vim-init'>
|
---|
201 | <title>Configuration Information</title>
|
---|
202 |
|
---|
203 | <para><application>Vim-7.0</application> introduced an
|
---|
204 | integrated spell checker that doesn't requires additional libraries to be
|
---|
205 | installed. To enable the spell checker you can set the following in
|
---|
206 | one of the configuration files: </para>
|
---|
207 |
|
---|
208 | <screen><literal>set spell
|
---|
209 | spelllang=en,ru</literal></screen>
|
---|
210 |
|
---|
211 | <para>By default, <application>Vim</application> only installs spell
|
---|
212 | files for the English language. If a spell file is not available for
|
---|
213 | your language, then <application>Vim</application> will call
|
---|
214 | <filename>$VIMRUNTIME/plugin/spellfile.vim</filename> and will try to
|
---|
215 | obtain the *.spl and optionally *.sug from the vim ftp server, using the
|
---|
216 | <filename>$VIMRUNTIME/plugin/netrw</filename> plugin.</para>
|
---|
217 |
|
---|
218 | <para>Alternatively you can manually download the *.spl and *.sug files
|
---|
219 | from: <ulink url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save
|
---|
220 | them to <filename class="directory"> ~/.vim/spell </filename> or in
|
---|
221 | <filename class="directory">
|
---|
222 | /usr/share/vim/vim70/spell/</filename>.</para>
|
---|
223 |
|
---|
224 | <para>For more information about the spell checker and some other
|
---|
225 | features in <application>Vim-&vim-version;</application> (such us
|
---|
226 | vimgrep, tab-pages, and omni-completion), issue the following command inside
|
---|
227 | <application>Vim</application>:</para>
|
---|
228 |
|
---|
229 | <screen><literal>:help version7</literal></screen>
|
---|
230 |
|
---|
231 | <para>For additional information on setting up
|
---|
232 | <application>Vim</application> configuration files, see <xref
|
---|
233 | linkend="postlfs-config-vimrc"/> and <ulink
|
---|
234 | url='http://www.vi-improved.org/vimrc.php'/>. </para>
|
---|
235 |
|
---|
236 | </sect3>
|
---|
237 |
|
---|
238 | </sect2>
|
---|
239 |
|
---|
240 | <sect2 role="content">
|
---|
241 | <title>Contents</title>
|
---|
242 |
|
---|
243 | <para>A list of the reinstalled files, along with their short
|
---|
244 | descriptions can be found in the <ulink
|
---|
245 | url="&lfs-root;/chapter06/vim.html#contents-vim">LFS Vim Installation
|
---|
246 | Instrutions</ulink></para>
|
---|
247 |
|
---|
248 | <segmentedlist>
|
---|
249 | <segtitle>Installed Programs</segtitle>
|
---|
250 | <segtitle>Installed Libraries</segtitle>
|
---|
251 | <segtitle>Installed Directory</segtitle>
|
---|
252 |
|
---|
253 | <seglistitem>
|
---|
254 | <seg>gview, gvim, gvimdiff, rgview, and rgvim</seg>
|
---|
255 | <seg>None</seg>
|
---|
256 | <seg>/usr/share/vim</seg>
|
---|
257 | </seglistitem>
|
---|
258 | </segmentedlist>
|
---|
259 |
|
---|
260 | <variablelist>
|
---|
261 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
262 | <?dbfo list-presentation="list"?>
|
---|
263 | <?dbhtml list-presentation="table"?>
|
---|
264 |
|
---|
265 | <varlistentry id="gview">
|
---|
266 | <term><command>gview</command></term>
|
---|
267 | <listitem>
|
---|
268 | <para>starts <command>gvim</command> in read-only mode.</para>
|
---|
269 | <indexterm zone="vim gview">
|
---|
270 | <primary sortas="b-gview">gview</primary>
|
---|
271 | </indexterm>
|
---|
272 | </listitem>
|
---|
273 | </varlistentry>
|
---|
274 |
|
---|
275 | <varlistentry id="gvim">
|
---|
276 | <term><command>gvim</command></term>
|
---|
277 | <listitem>
|
---|
278 | <para>is the editor that runs under <application>X</application>
|
---|
279 | and includes a GUI.</para>
|
---|
280 | <indexterm zone="vim gvim">
|
---|
281 | <primary sortas="b-gvim">gvim</primary>
|
---|
282 | </indexterm>
|
---|
283 | </listitem>
|
---|
284 | </varlistentry>
|
---|
285 |
|
---|
286 | <varlistentry id="gvimdiff">
|
---|
287 | <term><command>gvimdiff</command></term>
|
---|
288 | <listitem>
|
---|
289 | <para>edits two or three versions of a file with
|
---|
290 | <command>gvim</command> and shows the differences.</para>
|
---|
291 | <indexterm zone="vim gvimdiff">
|
---|
292 | <primary sortas="b-gvimdiff">gvimdiff</primary>
|
---|
293 | </indexterm>
|
---|
294 | </listitem>
|
---|
295 | </varlistentry>
|
---|
296 |
|
---|
297 | <varlistentry id="rgview">
|
---|
298 | <term><command>rgview</command></term>
|
---|
299 | <listitem>
|
---|
300 | <para>is a restricted version of <command>gview</command>.</para>
|
---|
301 | <indexterm zone="vim rgview">
|
---|
302 | <primary sortas="b-rgview">rgview</primary>
|
---|
303 | </indexterm>
|
---|
304 | </listitem>
|
---|
305 | </varlistentry>
|
---|
306 |
|
---|
307 | <varlistentry id="rgvim">
|
---|
308 | <term><command>rgvim</command></term>
|
---|
309 | <listitem>
|
---|
310 | <para>is a restricted version of <command>gvim</command>. </para>
|
---|
311 | <indexterm zone="vim gvim">
|
---|
312 | <primary sortas="b-gvim">gvim</primary>
|
---|
313 | </indexterm>
|
---|
314 | </listitem>
|
---|
315 | </varlistentry>
|
---|
316 |
|
---|
317 | </variablelist>
|
---|
318 |
|
---|
319 | </sect2>
|
---|
320 |
|
---|
321 | </sect1>
|
---|