source: BOOK/final-system/common/vim.xml@ 0f4dd37

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 0f4dd37 was e0e40d3, checked in by Jim Gifford <clfs@…>, 19 years ago

r781@server (orig r779): jim | 2005-11-30 22:14:06 -0800

r836@server: jim | 2005-11-30 22:13:02 -0800
Text updates to final-system


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