source: chapter06/vim.xml@ e4a5635

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

Replaced "<" by "less than".

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

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