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

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

Remove the vim cross-compile patch. It's been fixed enough upstream to rely on config.cache entries.

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