source: BOOK/final-system/common/vim.xml@ 4ba982a3

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 4ba982a3 was 3373dd11, checked in by Jim Gifford <clfs@…>, 19 years ago

r668@server (orig r666): manuel | 2005-11-08 15:25:13 -0800
Removing SBUs and DUs. Chapter final-system, round 6.

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