source: chapter06/vim.xml@ ed0843e

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 ed0843e was ed0843e, checked in by Archaic <archaic@…>, 18 years ago

Added symlink from vim.1 to vi.1.

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