source: chapter06/vim.xml@ c226182

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 c226182 was c226182, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Ported updates from 6.2 branch.
Small tags fixes.

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

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