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

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

LFS to CLFS changes.

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