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

Last change on this file since 8fedadb was 8fedadb, checked in by Joe Ciccone <jciccone@…>, 15 years ago

Add the VIM Branch Update -5 Patch.

  • Property mode set to 100644
File size: 15.3 KB
Line 
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
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="&cblfs-root;index.php/Category:Text_Editors"/>
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 merges all updates from the &vim-version; Branch
41    from the Vim developers:</para>
42
43<screen os="p2"><userinput>patch -Np1 -i ../&vim-branch_update-patch;</userinput></screen>
44
45    <para os="cc1">The configure script is full of logic that aborts at the
46    first sign of cross compiling. Set the cached values of those tests with
47    the following command:</para>
48
49<screen os="cc2"><userinput>echo "vim_cv_getcwd_broken=no" &gt; src/auto/config.cache
50echo "vim_cv_memmove_handles_overlap=yes" &gt;&gt; src/auto/config.cache
51echo "vim_cv_stat_ignores_slash=no" &gt;&gt; src/auto/config.cache
52echo "vim_cv_terminfo=yes" &gt;&gt; src/auto/config.cache
53echo "vim_cv_tgent=zero" &gt;&gt; src/auto/config.cache
54echo "vim_cv_toupper_broken=no" &gt;&gt; src/auto/config.cache
55echo "vim_cv_tty_group=world" &gt;&gt; src/auto/config.cache
56echo "ac_cv_sizeof_int=4" &gt;&gt; src/auto/config.cache</userinput></screen>
57
58    <para os="b">Change the default location of
59    the <filename>vimrc</filename> configuration file to <filename
60    class="directory">/etc</filename>:</para>
61
62<screen os="c"><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
63
64    <para os="d">Prepare Vim for compilation:</para>
65
66<screen os="e"><userinput>./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
67    --prefix=/usr --enable-multibyte --enable-gui=no \
68    --disable-gtktest --disable-xim --with-features=normal \
69    --disable-gpm --without-x --disable-netbeans \
70    --with-tlib=ncurses</userinput></screen>
71
72    <variablelist os="f">
73      <title>The meaning of the configure options:</title>
74
75      <varlistentry>
76        <term><parameter>--enable-multibyte</parameter></term>
77        <listitem>
78          <para>This optional but highly recommended switch enables support
79          for editing files in multibyte character encodings. This is needed
80          if using a locale with a multibyte character set. This switch is
81          also helpful to be able to edit text files initially created in
82          Linux distributions like Fedora Core that use UTF-8 as a default
83          character set.</para>
84        </listitem>
85      </varlistentry>
86
87    </variablelist>
88
89    <para os="g">Compile the package:</para>
90
91<screen os="h"><userinput>make</userinput></screen>
92
93    <para os="i">Install the package:</para>
94
95<screen os="j"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
96
97    <para os="k">Many users are accustomed to using <command>vi</command>
98    instead of <command>vim</command>. Some programs, such as
99    <command>vigr</command> and <command>vipw</command>, also use
100    <command>vi</command>. Create a symlink to permit execution of
101    <command>vim</command> when users habitually enter <command>vi</command>
102    and allow programs that use <command>vi</command> to work:</para>
103
104<screen os="l"><userinput>ln -sfv vim ${CLFS}/usr/bin/vi</userinput></screen>
105
106<para os="m">By default, Vim's documentation is installed in
107<filename class="directory">/usr/share/vim</filename>.  The following symlink
108allows the documentation to be accessed via
109<filename class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
110it consistent with the location of documentation for other packages:</para>
111
112<screen os="n"><userinput>ln -sfnv ../vim/vim&vim-version2;/doc ${CLFS}/usr/share/doc/vim-&vim-version;</userinput></screen>
113
114    <para os="o">If an X Window System is going to be installed on the CLFS
115    system, you may want to recompile Vim after installing X. Vim
116    comes with a GUI version of the editor that requires X and some
117    additional libraries to be installed. For more information, refer to the
118    Vim documentation and the Vim installation page in CBLFS at <ulink
119    url="&cblfs-root;index.php/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/vimrc">/etc/vimrc</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; ${CLFS}/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 role="nodump"><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 CLFS 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.