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

Last change on this file since bad66e0 was cc8d737, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Use cat instead of echo wherever possible.

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