source: chapter06/vim.xml@ e747759

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

Added sect1info blocks to packages pages.

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

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