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

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

Formatting update on the vim page.

  • Property mode set to 100644
File size: 15.0 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
64<screen os="c"><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
65
66 <para os="d">Prepare Vim for compilation:</para>
67
[cee2ca2]68<screen os="e"><userinput>./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
69 --prefix=/usr --enable-multibyte --enable-gui=no \
70 --disable-gtktest --disable-xim --with-features=normal \
71 --disable-gpm --without-x --disable-netbeans \
[817bb11]72 --with-tlib=ncurses</userinput></screen>
[02095ae]73
74 <variablelist os="f">
75 <title>The meaning of the configure options:</title>
76
77 <varlistentry>
78 <term><parameter>--enable-multibyte</parameter></term>
79 <listitem>
80 <para>This optional but highly recommended switch enables support
81 for editing files in multibyte character encodings. This is needed
82 if using a locale with a multibyte character set. This switch is
83 also helpful to be able to edit text files initially created in
84 Linux distributions like Fedora Core that use UTF-8 as a default
85 character set.</para>
86 </listitem>
87 </varlistentry>
88
89 </variablelist>
90
91 <para os="g">Compile the package:</para>
92
93<screen os="h"><userinput>make</userinput></screen>
94
[817bb11]95 <para os="i">Install the package:</para>
[02095ae]96
[586feb7]97<screen os="j"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
[02095ae]98
[5590e0d]99 <para os="k">Many users are accustomed to using <command>vi</command>
100 instead of <command>vim</command>. Some programs, such as
101 <command>vigr</command> and <command>vipw</command>, also use
102 <command>vi</command>. Create a symlink to permit execution of
103 <command>vim</command> when users habitually enter <command>vi</command>
104 and allow programs that use <command>vi</command> to work:</para>
[02095ae]105
[394cdeb]106<screen os="l"><userinput>ln -sfv vim ${CLFS}/usr/bin/vi</userinput></screen>
[02095ae]107
[817bb11]108<para os="m">By default, Vim's documentation is installed in
[02095ae]109<filename class="directory">/usr/share/vim</filename>. The following symlink
110allows the documentation to be accessed via
111<filename class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
112it consistent with the location of documentation for other packages:</para>
113
[394cdeb]114<screen os="n"><userinput>ln -sfnv ../vim/vim&vim-version2;/doc ${CLFS}/usr/share/doc/vim-&vim-version;</userinput></screen>
[02095ae]115
[1a09536]116 <para os="o">If an X Window System is going to be installed on the CLFS
[5590e0d]117 system, you may want to recompile Vim after installing X. Vim
[02095ae]118 comes with a GUI version of the editor that requires X and some
[5590e0d]119 additional libraries to be installed. For more information, refer to the
[f3a1e98]120 Vim documentation and the Vim installation page in CBLFS at <ulink
121 url="&cblfs-root;index.php/Vim"/>.</para>
[02095ae]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/vimrc">/etc/vimrc</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
[586feb7]142<screen><userinput>cat &gt; ${CLFS}/etc/vimrc &lt;&lt; "EOF"
[02095ae]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 role="nodump"><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
[755f44a]391 is provided neither in CLFS nor in BLFS</para>
[02095ae]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.