source: chapter06/vim.xml@ ead6e7a

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 ead6e7a was ead6e7a, checked in by Matthew Burgess <matthew@…>, 17 years ago

Apply some upstream fixes to Vim.

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

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