source: clfs-sysroot/BOOK/final-system/common/vim.xml@ aa7d916

Last change on this file since aa7d916 was 1a09536, checked in by Joe Ciccone <jciccone@…>, 18 years ago

More LFS to CLFS updates.

  • Property mode set to 100644
File size: 14.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-vim" role="wrap">
9 <?dbhtml filename="vim.html"?>
10
11 <title>Vim-&vim-version;</title>
12
13 <indexterm zone="ch-system-vim">
14 <primary sortas="a-Vim">Vim</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Vim package contains a powerful text editor.</para>
21
22 <tip>
23 <title>Alternatives to Vim</title>
24
25 <para>If you prefer another editor&mdash;such as Emacs, Joe, or
26 Nano&mdash;please refer to <ulink
27 url="&blfs-root;view/svn/postlfs/editors.html"/>
28 for suggested installation instructions.</para>
29 </tip>
30
31 </sect2>
32
33 <sect2 role="installation">
34 <title>Installation of Vim</title>
35
36 <para os="a">First, unpack both <filename>vim-&vim-version;.tar.bz2</filename>
37 and (optionally) <filename>vim-&vim-version;-lang.tar.gz</filename>
38 archives into the same directory.</para>
39
40 <para os="p1">The following patch fixes numerous issues with
41 cross-compiling vim</para>
42
43<screen os="p2"><userinput>patch -Np1 -i ../&vim-cross_compile-patch;</userinput></screen>
44
45 <para os="p3">The following patch contains updates from the maintainer. The
46 maintainer of Vim only releases these patches to fix serious issues.</para>
47
48<screen os="p4"><userinput>patch -Np1 -i ../&vim-fixes-patch;</userinput></screen>
49
50 <para os="b">Change the default location of
51 the <filename>vimrc</filename> configuration file to <filename
52 class="directory">/etc</filename>:</para>
53
54<screen os="c"><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
55
56 <para os="d">Prepare Vim for compilation:</para>
57
58<screen os="e"><userinput>./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
59 --prefix=/usr --enable-multibyte --enable-gui=no \
60 --disable-gtktest --disable-xim --with-features=normal \
61 --disable-gpm --without-x --disable-netbeans \
62 --with-tlib=ncurses</userinput></screen>
63
64 <variablelist os="f">
65 <title>The meaning of the configure options:</title>
66
67 <varlistentry>
68 <term><parameter>--enable-multibyte</parameter></term>
69 <listitem>
70 <para>This optional but highly recommended switch enables support
71 for editing files in multibyte character encodings. This is needed
72 if using a locale with a multibyte character set. This switch is
73 also helpful to be able to edit text files initially created in
74 Linux distributions like Fedora Core that use UTF-8 as a default
75 character set.</para>
76 </listitem>
77 </varlistentry>
78
79 </variablelist>
80
81 <para os="g">Compile the package:</para>
82
83<screen os="h"><userinput>make</userinput></screen>
84
85 <para os="i">Install the package:</para>
86
87<screen os="j"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
88
89 <para os="k">Many users are accustomed to using <command>vi</command>
90 instead of <command>vim</command>. Some programs, such as
91 <command>vigr</command> and <command>vipw</command>, also use
92 <command>vi</command>. Create a symlink to permit execution of
93 <command>vim</command> when users habitually enter <command>vi</command>
94 and allow programs that use <command>vi</command> to work:</para>
95
96<screen os="l"><userinput>ln -sv vim ${CLFS}/usr/bin/vi</userinput></screen>
97
98<para os="m">By default, Vim's documentation is installed in
99<filename class="directory">/usr/share/vim</filename>. The following symlink
100allows the documentation to be accessed via
101<filename class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
102it consistent with the location of documentation for other packages:</para>
103
104<screen os="n"><userinput>ln -sv ../vim/vim&vim-version2;/doc ${CLFS}/usr/share/doc/vim-&vim-version;</userinput></screen>
105
106 <para os="o">If an X Window System is going to be installed on the CLFS
107 system, you may want to recompile Vim after installing X. Vim
108 comes with a GUI version of the editor that requires X and some
109 additional libraries to be installed. For more information, refer to the
110 Vim documentation and the Vim installation page
111 in the BLFS book at <ulink
112 url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
113
114 </sect2>
115
116 <sect2 id="conf-vim" role="configuration">
117 <title>Configuring Vim</title>
118
119 <indexterm zone="conf-vim">
120 <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
121 </indexterm>
122
123 <para>By default, <command>vim</command> runs in vi-incompatible mode.
124 This may be new to users who have used other editors in the past. The
125 <quote>nocompatible</quote> setting is included below to highlight the
126 fact that a new behavior is being used. It also reminds those who would
127 change to <quote>compatible</quote> mode that it should be the first
128 setting in the configuration file. This is necessary because it changes
129 other settings, and overrides must come after this setting. Create a
130 default <command>vim</command> configuration file by running the
131 following:</para>
132
133<screen><userinput>cat &gt; ${CLFS}/etc/vimrc &lt;&lt; "EOF"
134<literal>" Begin /etc/vimrc
135
136set nocompatible
137set backspace=2
138syntax on
139if (&amp;term == "iterm") || (&amp;term == "putty")
140 set background=dark
141endif
142
143" End /etc/vimrc</literal>
144EOF</userinput></screen>
145
146
147 <para>The <parameter>set nocompatible</parameter> makes
148 <command>vim</command> behave in a more useful way (the default) than
149 the vi-compatible manner. Remove the <quote>no</quote> to keep the
150 old <command>vi</command> behavior. The <parameter>set
151 backspace=2</parameter> allows backspacing over line breaks,
152 autoindents, and the start of insert. The <parameter>syntax
153 on</parameter> enables vim's syntax highlighting. Finally, the
154 <emphasis>if</emphasis> statement with the <parameter>set
155 background=dark</parameter> corrects <command>vim</command>'s guess
156 about the background color of some terminal emulators. This gives the
157 highlighting a better color scheme for use on the black background of
158 these programs.</para>
159
160 <para>Documentation for other available options can be obtained by
161 running the following command:</para>
162
163<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
164
165 </sect2>
166
167 <sect2 id="contents-vim" role="content">
168 <title>Contents of Vim</title>
169
170 <segmentedlist>
171 <segtitle>Installed programs</segtitle>
172
173 <seglistitem>
174 <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
175 pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
176 tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
177 vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg>
178 </seglistitem>
179 </segmentedlist>
180
181 <variablelist>
182 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
183 <?dbfo list-presentation="list"?>
184 <?dbhtml list-presentation="table"?>
185
186 <varlistentry id="efm_filter.pl">
187 <term><command>efm_filter.pl</command></term>
188 <listitem>
189 <para>A filter for creating an error file that can be read
190 by <command>vim</command></para>
191 <indexterm zone="ch-system-vim efm_filter.pl">
192 <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
193 </indexterm>
194 </listitem>
195 </varlistentry>
196
197 <varlistentry id="efm_perl.pl">
198 <term><command>efm_perl.pl</command></term>
199 <listitem>
200 <para>Reformats the error messages of the Perl interpreter for use
201 with the <quote>quickfix</quote> mode of <command>vim</command></para>
202 <indexterm zone="ch-system-vim efm_perl.pl">
203 <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
204 </indexterm>
205 </listitem>
206 </varlistentry>
207
208 <varlistentry id="ex">
209 <term><command>ex</command></term>
210 <listitem>
211 <para>Starts <command>vim</command> in ex mode</para>
212 <indexterm zone="ch-system-vim ex">
213 <primary sortas="b-ex">ex</primary>
214 </indexterm>
215 </listitem>
216 </varlistentry>
217
218 <varlistentry id="less.sh">
219 <term><command>less.sh</command></term>
220 <listitem>
221 <para>A script that starts <command>vim</command> with less.vim</para>
222 <indexterm zone="ch-system-vim less.sh">
223 <primary sortas="b-less.sh">less.sh</primary>
224 </indexterm>
225 </listitem>
226 </varlistentry>
227
228 <varlistentry id="mve.awk">
229 <term><command>mve.awk</command></term>
230 <listitem>
231 <para>Processes <command>vim</command> errors</para>
232 <indexterm zone="ch-system-vim mve.awk">
233 <primary sortas="b-mve.awk">mve.awk</primary>
234 </indexterm>
235 </listitem>
236 </varlistentry>
237
238 <varlistentry id="pltags.pl">
239 <term><command>pltags.pl</command></term>
240 <listitem>
241 <para>Creates a tags file for Perl code for use by
242 <command>vim</command></para>
243 <indexterm zone="ch-system-vim pltags.pl">
244 <primary sortas="b-pltags.pl">pltags.pl</primary>
245 </indexterm>
246 </listitem>
247 </varlistentry>
248
249 <varlistentry id="ref">
250 <term><command>ref</command></term>
251 <listitem>
252 <para>Checks the spelling of arguments</para>
253 <indexterm zone="ch-system-vim ref">
254 <primary sortas="b-ref">ref</primary>
255 </indexterm>
256 </listitem>
257 </varlistentry>
258
259 <varlistentry id="rview">
260 <term><command>rview</command></term>
261 <listitem>
262 <para>Is a restricted version of <command>view</command>; no shell
263 commands can be started and <command>view</command> cannot be
264 suspended</para>
265 <indexterm zone="ch-system-vim rview">
266 <primary sortas="b-rview">rview</primary>
267 </indexterm>
268 </listitem>
269 </varlistentry>
270
271 <varlistentry id="rvim">
272 <term><command>rvim</command></term>
273 <listitem>
274 <para>Is a restricted version of <command>vim</command>; no shell
275 commands can be started and <command>vim</command> cannot be
276 suspended</para>
277 <indexterm zone="ch-system-vim rvim">
278 <primary sortas="b-rvim">rvim</primary>
279 </indexterm>
280 </listitem>
281 </varlistentry>
282
283 <varlistentry id="shtags.pl">
284 <term><command>shtags.pl</command></term>
285 <listitem>
286 <para>Generates a tags file for Perl scripts</para>
287 <indexterm zone="ch-system-vim shtags.pl">
288 <primary sortas="b-shtags.pl">shtags.pl</primary>
289 </indexterm>
290 </listitem>
291 </varlistentry>
292
293 <varlistentry id="tcltags">
294 <term><command>tcltags</command></term>
295 <listitem>
296 <para>Generates a tags file for TCL code</para>
297 <indexterm zone="ch-system-vim tcltags">
298 <primary sortas="b-tcltags">tcltags</primary>
299 </indexterm>
300 </listitem>
301 </varlistentry>
302
303 <varlistentry id="view">
304 <term><command>view</command></term>
305 <listitem>
306 <para>Starts <command>vim</command> in read-only mode</para>
307 <indexterm zone="ch-system-vim view">
308 <primary sortas="b-view">view</primary>
309 </indexterm>
310 </listitem>
311 </varlistentry>
312
313 <varlistentry id="vi">
314 <term><command>vi</command></term>
315 <listitem>
316 <para>Link to <command>vim</command></para>
317 <indexterm zone="ch-system-vim vi">
318 <primary sortas="b-vi">vi</primary>
319 </indexterm>
320 </listitem>
321 </varlistentry>
322
323 <varlistentry id="vim">
324 <term><command>vim</command></term>
325 <listitem>
326 <para>Is the editor</para>
327 <indexterm zone="ch-system-vim vim">
328 <primary sortas="b-vim">vim</primary>
329 </indexterm>
330 </listitem>
331 </varlistentry>
332
333 <varlistentry id="vim132">
334 <term><command>vim132</command></term>
335 <listitem>
336 <para>Starts <command>vim</command> with the terminal in 132-column
337 mode</para>
338 <indexterm zone="ch-system-vim vim132">
339 <primary sortas="b-vim132">vim132</primary>
340 </indexterm>
341 </listitem>
342 </varlistentry>
343
344 <varlistentry id="vim2html.pl">
345 <term><command>vim2html.pl</command></term>
346 <listitem>
347 <para>Converts Vim documentation to HypterText Markup Language
348 (HTML)</para>
349 <indexterm zone="ch-system-vim vim2html.pl">
350 <primary sortas="b-vim2html.pl">vim2html.pl</primary>
351 </indexterm>
352 </listitem>
353 </varlistentry>
354
355 <varlistentry id="vimdiff">
356 <term><command>vimdiff</command></term>
357 <listitem>
358 <para>Edits two or three versions of a file with <command>vim</command>
359 and show differences</para>
360 <indexterm zone="ch-system-vim vimdiff">
361 <primary sortas="b-vimdiff">vimdiff</primary>
362 </indexterm>
363 </listitem>
364 </varlistentry>
365
366 <varlistentry id="vimm">
367 <term><command>vimm</command></term>
368 <listitem>
369 <para>Enables the DEC locator input model on a remote terminal</para>
370 <indexterm zone="ch-system-vim vimm">
371 <primary sortas="b-vimm">vimm</primary>
372 </indexterm>
373 </listitem>
374 </varlistentry>
375
376 <varlistentry id="vimspell.sh">
377 <term><command>vimspell.sh</command></term>
378 <listitem>
379 <para>Spell checks a file and generates the syntax statements
380 necessary to highlight in <command>vim</command>. This script
381 requires the old Unix <command>spell</command> command, which
382 is provided neither in CLFS nor in BLFS</para>
383 <indexterm zone="ch-system-vim vimspell.sh">
384 <primary sortas="b-vimspell.sh">vimspell.sh</primary>
385 </indexterm>
386 </listitem>
387 </varlistentry>
388
389 <varlistentry id="vimtutor">
390 <term><command>vimtutor</command></term>
391 <listitem>
392 <para>Teaches the basic keys and commands of
393 <command>vim</command></para>
394 <indexterm zone="ch-system-vim vimtutor">
395 <primary sortas="b-vimtutor">vimtutor</primary>
396 </indexterm>
397 </listitem>
398 </varlistentry>
399
400 <varlistentry id="xxd">
401 <term><command>xxd</command></term>
402 <listitem>
403 <para>Creates a hex dump of the given file; it can
404 also do the reverse, so it can be used for binary patching</para>
405 <indexterm zone="ch-system-vim xxd">
406 <primary sortas="b-xxd">xxd</primary>
407 </indexterm>
408 </listitem>
409 </varlistentry>
410
411 </variablelist>
412
413 </sect2>
414
415</sect1>
Note: See TracBrowser for help on using the repository browser.