source: chapter06/vim.xml@ 2fe5051a

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 2fe5051a was 2fe5051a, checked in by Jeremy Huntwork <jhuntwork@…>, 18 years ago

Updated to Vim-7.0. Fixes #1793.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7628 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • 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.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 <segmentedlist>
23 <segtitle>&buildtime;</segtitle>
24 <segtitle>&diskspace;</segtitle>
25
26 <seglistitem>
27 <seg>&vim-ch6-sbu;</seg>
28 <seg>&vim-ch6-du;</seg>
29 </seglistitem>
30 </segmentedlist>
31
32 <tip>
33 <title>Alternatives to Vim</title>
34
35 <para>If you prefer another editor&mdash;such as Emacs, Joe, or
36 Nano&mdash;please refer to <ulink
37 url="&blfs-root;view/svn/postlfs/editors.html"/> for suggested
38 installation instructions.</para>
39 </tip>
40
41 </sect2>
42
43 <sect2 role="installation">
44 <title>Installation of Vim</title>
45
46 <para>First, unpack both
47 <filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
48 <filename>vim-&vim-version;-lang.tar.gz</filename> archives into the
49 same directory. Then, patch Vim with several fixes from upstream
50 developers since the initial release of Vim-&vim-version;:</para>
51
52<screen><userinput>patch -Np1 -i ../&vim-fixes-patch;</userinput></screen>
53
54 <para>Next, change the default location of the
55 <filename>vimrc</filename> configuration file to <filename
56 class="directory">/etc</filename>:</para>
57
58<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
59
60 <para>Now prepare Vim for compilation:</para>
61
62<screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
63
64 <variablelist>
65 <title>The meaning of the configure options:</title>
66
67 <varlistentry>
68 <term><parameter>--enable-multibyte</parameter></term>
69 <listitem>
70 <para>This switch enables support for editing files in multibyte
71 character encodings. This is needed if using a locale with a
72 multibyte character set. This switch is also helpful to be able
73 to edit text files initially created in Linux distributions like
74 Fedora Core that use UTF-8 as a default character set.</para>
75 </listitem>
76 </varlistentry>
77
78 </variablelist>
79
80 <para>Compile the package:</para>
81
82<screen><userinput>make</userinput></screen>
83
84 <para>To test the results, issue: <userinput>make test</userinput>. However,
85 this test suite outputs a lot of binary data to the screen, which can cause
86 issues with the settings of the current terminal. This can be resolved by
87 redirecting the output to a log file.</para>
88
89 <para>Install the package:</para>
90
91<screen><userinput>make install</userinput></screen>
92
93 <para>In UTF-8 locales, the <command>vimtutor</command> program tries to
94 convert the tutorials from ISO-8859-1 to UTF-8. Since some tutorials are
95 not in ISO-8859-1, the text in them is thus made unreadable. If you
96 unpacked the <filename>vim-&vim-version;-lang.tar.gz</filename> archive
97 and are going to use a UTF-8 based locale, remove non-ISO-8859-1 tutorials.
98 An English tutorial will be used instead.</para>
99 <!-- Removal is used instead of conversion in order for the user to be able to
100 painlessly revert his UTF-8 locale choice. -->
101
102<screen><userinput>rm -f /usr/share/vim/vim64/tutor/tutor.{gr,pl,ru,sk}
103rm -f /usr/share/vim/vim64/tutor/tutor.??.*</userinput></screen>
104
105 <para>Many users are used to using <command>vi</command> instead of
106 <command>vim</command>. To allow execution of <command>vim</command>
107 when users habitually enter <command>vi</command>, create a
108 symlink for both the binary and the man-page:</para>
109
110<screen><userinput>ln -sv vim /usr/bin/vi
111ln -sv vim.1 /usr/share/man/man1/vi.1</userinput></screen>
112
113 <para>By default, Vim's documentation is installed in <filename
114 class="directory">/usr/share/vim</filename>. The following symlink
115 allows the documentation to be accessed via <filename
116 class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
117 it consistent with the location of documentation for other packages:</para>
118
119<screen><userinput>ln -sv ../vim/vim64/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
120
121 <para>If an X Window System is going to be installed on the LFS
122 system, it may be necessary to recompile Vim after installing X. Vim
123 comes with a GUI version of the editor that requires X and some
124 additional libraries to be installed. For more information on this
125 process, refer to the Vim documentation and the Vim installation page
126 in the BLFS book at <ulink
127 url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
128
129 </sect2>
130
131 <sect2 id="conf-vim" role="configuration">
132 <title>Configuring Vim</title>
133
134 <indexterm zone="conf-vim">
135 <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
136 </indexterm>
137
138 <para>By default, <command>vim</command> runs in vi-incompatible mode.
139 This may be new to users who have used other editors in the past. The
140 <quote>nocompatible</quote> setting is included below to highlight the
141 fact that a new behavior is being used. It also reminds those who would
142 change to <quote>compatible</quote> mode that it should be the first
143 setting in the configuration file. This is necessary because it changes
144 other settings, and overrides must come after this setting. Create a default
145 <command>vim</command> configuration file by running the following:</para>
146
147<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
148<literal>" Begin /etc/vimrc
149
150set nocompatible
151set backspace=2
152syntax on
153if (&amp;term == "iterm") || (&amp;term == "putty")
154 set background=dark
155endif
156
157" End /etc/vimrc</literal>
158EOF</userinput></screen>
159
160 <para>The <parameter>set nocompatible</parameter> makes
161 <command>vim</command> behave in a more useful way (the default) than
162 the vi-compatible manner. Remove the <quote>no</quote> to keep the
163 old <command>vi</command> behavior. The <parameter>set
164 backspace=2</parameter> allows backspacing over line breaks,
165 autoindents, and the start of insert. The <parameter>syntax
166 on</parameter> enables vim's syntax highlighting. Finally, the
167 <emphasis>if</emphasis> statement with the <parameter>set
168 background=dark</parameter> corrects <command>vim</command>'s guess
169 about the background color of some terminal emulators. This gives the
170 highlighting a better color scheme for use on the black background of
171 these programs.</para>
172
173 <para>Documentation for other available options can be obtained by
174 running the following command:</para>
175
176<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
177
178 </sect2>
179
180 <sect2 id="contents-vim" role="content">
181 <title>Contents of Vim</title>
182
183 <segmentedlist>
184 <segtitle>Installed programs</segtitle>
185
186 <seglistitem>
187 <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
188 pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
189 tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
190 vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg>
191 </seglistitem>
192 </segmentedlist>
193
194 <variablelist>
195 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
196 <?dbfo list-presentation="list"?>
197 <?dbhtml list-presentation="table"?>
198
199 <varlistentry id="efm_filter.pl">
200 <term><command>efm_filter.pl</command></term>
201 <listitem>
202 <para>A filter for creating an error file that can be read
203 by <command>vim</command></para>
204 <indexterm zone="ch-system-vim efm_filter.pl">
205 <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
206 </indexterm>
207 </listitem>
208 </varlistentry>
209
210 <varlistentry id="efm_perl.pl">
211 <term><command>efm_perl.pl</command></term>
212 <listitem>
213 <para>Reformats the error messages of the Perl interpreter for use
214 with the <quote>quickfix</quote> mode of <command>vim</command></para>
215 <indexterm zone="ch-system-vim efm_perl.pl">
216 <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
217 </indexterm>
218 </listitem>
219 </varlistentry>
220
221 <varlistentry id="ex">
222 <term><command>ex</command></term>
223 <listitem>
224 <para>Starts <command>vim</command> in ex mode</para>
225 <indexterm zone="ch-system-vim ex">
226 <primary sortas="b-ex">ex</primary>
227 </indexterm>
228 </listitem>
229 </varlistentry>
230
231 <varlistentry id="less.sh">
232 <term><command>less.sh</command></term>
233 <listitem>
234 <para>A script that starts <command>vim</command> with less.vim</para>
235 <indexterm zone="ch-system-vim less.sh">
236 <primary sortas="b-less.sh">less.sh</primary>
237 </indexterm>
238 </listitem>
239 </varlistentry>
240
241 <varlistentry id="mve.awk">
242 <term><command>mve.awk</command></term>
243 <listitem>
244 <para>Processes <command>vim</command> errors</para>
245 <indexterm zone="ch-system-vim mve.awk">
246 <primary sortas="b-mve.awk">mve.awk</primary>
247 </indexterm>
248 </listitem>
249 </varlistentry>
250
251 <varlistentry id="pltags.pl">
252 <term><command>pltags.pl</command></term>
253 <listitem>
254 <para>Creates a tags file for Perl code for use by
255 <command>vim</command></para>
256 <indexterm zone="ch-system-vim pltags.pl">
257 <primary sortas="b-pltags.pl">pltags.pl</primary>
258 </indexterm>
259 </listitem>
260 </varlistentry>
261
262 <varlistentry id="ref">
263 <term><command>ref</command></term>
264 <listitem>
265 <para>Checks the spelling of arguments</para>
266 <indexterm zone="ch-system-vim ref">
267 <primary sortas="b-ref">ref</primary>
268 </indexterm>
269 </listitem>
270 </varlistentry>
271
272 <varlistentry id="rview">
273 <term><command>rview</command></term>
274 <listitem>
275 <para>Is a restricted version of <command>view</command>; no shell
276 commands can be started and <command>view</command> cannot be
277 suspended</para>
278 <indexterm zone="ch-system-vim rview">
279 <primary sortas="b-rview">rview</primary>
280 </indexterm>
281 </listitem>
282 </varlistentry>
283
284 <varlistentry id="rvim">
285 <term><command>rvim</command></term>
286 <listitem>
287 <para>Is a restricted version of <command>vim</command>; no shell
288 commands can be started and <command>vim</command> cannot be
289 suspended</para>
290 <indexterm zone="ch-system-vim rvim">
291 <primary sortas="b-rvim">rvim</primary>
292 </indexterm>
293 </listitem>
294 </varlistentry>
295
296 <varlistentry id="shtags.pl">
297 <term><command>shtags.pl</command></term>
298 <listitem>
299 <para>Generates a tags file for Perl scripts</para>
300 <indexterm zone="ch-system-vim shtags.pl">
301 <primary sortas="b-shtags.pl">shtags.pl</primary>
302 </indexterm>
303 </listitem>
304 </varlistentry>
305
306 <varlistentry id="tcltags">
307 <term><command>tcltags</command></term>
308 <listitem>
309 <para>Generates a tags file for TCL code</para>
310 <indexterm zone="ch-system-vim tcltags">
311 <primary sortas="b-tcltags">tcltags</primary>
312 </indexterm>
313 </listitem>
314 </varlistentry>
315
316 <varlistentry id="view">
317 <term><command>view</command></term>
318 <listitem>
319 <para>Starts <command>vim</command> in read-only mode</para>
320 <indexterm zone="ch-system-vim view">
321 <primary sortas="b-view">view</primary>
322 </indexterm>
323 </listitem>
324 </varlistentry>
325
326 <varlistentry id="vi">
327 <term><command>vi</command></term>
328 <listitem>
329 <para>Link to <command>vim</command></para>
330 <indexterm zone="ch-system-vim vi">
331 <primary sortas="b-vi">vi</primary>
332 </indexterm>
333 </listitem>
334 </varlistentry>
335
336 <varlistentry id="vim">
337 <term><command>vim</command></term>
338 <listitem>
339 <para>Is the editor</para>
340 <indexterm zone="ch-system-vim vim">
341 <primary sortas="b-vim">vim</primary>
342 </indexterm>
343 </listitem>
344 </varlistentry>
345
346 <varlistentry id="vim132">
347 <term><command>vim132</command></term>
348 <listitem>
349 <para>Starts <command>vim</command> with the terminal in 132-column
350 mode</para>
351 <indexterm zone="ch-system-vim vim132">
352 <primary sortas="b-vim132">vim132</primary>
353 </indexterm>
354 </listitem>
355 </varlistentry>
356
357 <varlistentry id="vim2html.pl">
358 <term><command>vim2html.pl</command></term>
359 <listitem>
360 <para>Converts Vim documentation to HypterText Markup Language
361 (HTML)</para>
362 <indexterm zone="ch-system-vim vim2html.pl">
363 <primary sortas="b-vim2html.pl">vim2html.pl</primary>
364 </indexterm>
365 </listitem>
366 </varlistentry>
367
368 <varlistentry id="vimdiff">
369 <term><command>vimdiff</command></term>
370 <listitem>
371 <para>Edits two or three versions of a file with <command>vim</command>
372 and show differences</para>
373 <indexterm zone="ch-system-vim vimdiff">
374 <primary sortas="b-vimdiff">vimdiff</primary>
375 </indexterm>
376 </listitem>
377 </varlistentry>
378
379 <varlistentry id="vimm">
380 <term><command>vimm</command></term>
381 <listitem>
382 <para>Enables the DEC locator input model on a remote terminal</para>
383 <indexterm zone="ch-system-vim vimm">
384 <primary sortas="b-vimm">vimm</primary>
385 </indexterm>
386 </listitem>
387 </varlistentry>
388
389 <varlistentry id="vimspell.sh">
390 <term><command>vimspell.sh</command></term>
391 <listitem>
392 <para>Spell checks a file and generates the syntax statements
393 necessary to highlight in <command>vim</command>. This script
394 requires the old Unix <command>spell</command> command, which
395 is provided neither in LFS nor in BLFS</para>
396 <indexterm zone="ch-system-vim vimspell.sh">
397 <primary sortas="b-vimspell.sh">vimspell.sh</primary>
398 </indexterm>
399 </listitem>
400 </varlistentry>
401
402 <varlistentry id="vimtutor">
403 <term><command>vimtutor</command></term>
404 <listitem>
405 <para>Teaches the basic keys and commands of
406 <command>vim</command></para>
407 <indexterm zone="ch-system-vim vimtutor">
408 <primary sortas="b-vimtutor">vimtutor</primary>
409 </indexterm>
410 </listitem>
411 </varlistentry>
412
413 <varlistentry id="xxd">
414 <term><command>xxd</command></term>
415 <listitem>
416 <para>Creates a hex dump of the given file; it can
417 also do the reverse, so it can be used for binary patching</para>
418 <indexterm zone="ch-system-vim xxd">
419 <primary sortas="b-xxd">xxd</primary>
420 </indexterm>
421 </listitem>
422 </varlistentry>
423
424 </variablelist>
425
426 </sect2>
427
428</sect1>
Note: See TracBrowser for help on using the repository browser.