source: chapter06/vim.xml@ 241bb14

6.1.1
Last change on this file since 241bb14 was e925d78a, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Ported several typos and redaction fixes from trunk.

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

  • Property mode set to 100644
File size: 12.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-vim" role="wrap">
7<title>Vim-&vim-version;</title>
8<?dbhtml filename="vim.html"?>
9
10<indexterm zone="ch-system-vim"><primary sortas="a-Vim">Vim</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Vim package contains a powerful text editor.</para>
14
15<segmentedlist>
16<segtitle>&buildtime;</segtitle>
17<segtitle>&diskspace;</segtitle>
18<seglistitem><seg>0.4 SBU</seg><seg>38.0 MB</seg></seglistitem>
19</segmentedlist>
20
21<segmentedlist>
22<segtitle>&dependencies;</segtitle>
23<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
24GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem>
25</segmentedlist>
26
27<tip>
28<title>Alternatives to Vim</title>
29<para>If you prefer another editor&mdash;such as Emacs, Joe, or
30Nano&mdash;please refer to <ulink url="&blfs-root;view/svn/postlfs/editors.html"/>
31for suggested installation instructions.</para>
32</tip>
33</sect2>
34
35<sect2 role="installation">
36<title>Installation of Vim</title>
37
38<para>First, unpack both
39<filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
40<filename>vim-&vim-version;-lang.tar.gz</filename> archives into the
41same directory. Then, change the default location of the
42<filename>vimrc</filename> configuration file to <filename
43class="directory">/etc</filename>:</para>
44
45<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
46
47<para>Vim has two known security vulnerabilities that have already been
48addressed upstream. The following patch fixes the problems:</para>
49
50<screen><userinput>patch -Np1 -i ../&vim-security_fix-patch;</userinput></screen>
51
52<para>Now prepare Vim for compilation:</para>
53
54<screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
55
56<para>The meaning of the configure options:</para>
57
58<variablelist>
59<varlistentry>
60<term><parameter>--enable-multibyte</parameter></term>
61<listitem><para>This optional but highly recommended switch enables support for
62editing files in multibyte character encodings. This is needed if using a
63locale with a multibyte character set. This switch is also helpful to be able to
64edit text files initially created in Linux distributions like Fedora Core that
65use UTF-8 as a default character set.</para>
66</listitem>
67</varlistentry>
68</variablelist>
69
70<para>Compile the package:</para>
71
72<screen><userinput>make</userinput></screen>
73
74<para>To test the results, issue: <userinput>make test</userinput>. However,
75this test suite outputs a lot of binary data to the screen, which can cause
76issues with the settings of the current terminal. This can be resolved by
77redirecting the output to a log file.</para>
78
79<para>Install the package:</para>
80
81<screen><userinput>make install</userinput></screen>
82
83<para>Many users are used to using <command>vi</command> instead of
84<command>vim</command>. To allow execution of <command>vim</command>
85when users habitually enter <command>vi</command>, create a
86symlink:</para>
87
88<screen><userinput>ln -sv vim /usr/bin/vi</userinput></screen>
89
90<para>If an X Window System is going to be installed on the LFS
91system, it may be necessary to recompile Vim after installing X. Vim
92comes with a GUI version of the editor that requires X and some
93additional libraries to be installed. For more information on this
94process, refer to the Vim documentation and the Vim installation page
95in the BLFS book at <ulink
96url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
97
98</sect2>
99
100<sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
101<indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
102
103<para>By default, <command>vim</command> runs in vi-incompatible mode. This may
104be new to users who have used other editors in the past. The
105<quote>nocompatible</quote> setting is included below to highlight the fact that
106a new behavior is being used. It also reminds those who would change to
107<quote>compatible</quote> mode that it should be the first setting in the
108configuration file. This is necessary because it changes other settings, and
109overrides must come after this setting. Create a default <command>vim</command>
110configuration file by running the following:</para>
111
112<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
113<literal>" Begin /etc/vimrc
114
115set nocompatible
116set backspace=2
117syntax on
118if (&amp;term == "iterm") || (&amp;term == "putty")
119 set background=dark
120endif
121
122" End /etc/vimrc</literal>
123EOF</userinput></screen>
124
125<para>The <parameter>set nocompatible</parameter> makes
126<command>vim</command> behave in a more useful way (the default) than
127the vi-compatible manner. Remove the <quote>no</quote> to keep the
128old <command>vi</command> behavior. The <parameter>set
129backspace=2</parameter> allows backspacing over line breaks,
130autoindents, and the start of insert. The <parameter>syntax
131on</parameter> enables vim's syntax highlighting. Finally, the
132<emphasis>if</emphasis> statement with the <parameter>set
133background=dark</parameter> corrects <command>vim</command>'s guess
134about the background color of some terminal emulators. This gives the
135highlighting a better color scheme for use on the black background of
136these programs.</para>
137
138<para>Documentation for other available options can be obtained by
139running the following command:</para>
140
141<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
142
143</sect2>
144
145<sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
146
147<segmentedlist>
148<segtitle>Installed programs</segtitle>
149<seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
150pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
151view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
152vimtutor, and xxd</seg></seglistitem>
153</segmentedlist>
154
155<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
156<?dbfo list-presentation="list"?>
157<?dbhtml list-presentation="table"?>
158
159<varlistentry id="efm_filter.pl">
160<term><command>efm_filter.pl</command></term>
161<listitem>
162<para>A filter for creating an error file that can be read by <command>vim</command></para>
163<indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
164</listitem>
165</varlistentry>
166
167<varlistentry id="efm_perl.pl">
168<term><command>efm_perl.pl</command></term>
169<listitem>
170<para>Reformats the error messages of the
171Perl interpreter for use with the <quote>quickfix</quote> mode of <command>vim</command></para>
172<indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
173</listitem>
174</varlistentry>
175
176<varlistentry id="ex">
177<term><command>ex</command></term>
178<listitem>
179<para>Starts <command>vim</command> in ex mode</para>
180<indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
181</listitem>
182</varlistentry>
183
184<varlistentry id="less.sh">
185<term><command>less.sh</command></term>
186<listitem>
187<para>A script that starts <command>vim</command> with less.vim</para>
188<indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
189</listitem>
190</varlistentry>
191
192<varlistentry id="mve.awk">
193<term><command>mve.awk</command></term>
194<listitem>
195<para>Processes <command>vim</command> errors</para>
196<indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
197</listitem>
198</varlistentry>
199
200<varlistentry id="pltags.pl">
201<term><command>pltags.pl</command></term>
202<listitem>
203<para>Creates a tags file for Perl code for use by <command>vim</command></para>
204<indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
205</listitem>
206</varlistentry>
207
208<varlistentry id="ref">
209<term><command>ref</command></term>
210<listitem>
211<para>Checks the spelling of arguments</para>
212<indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
213</listitem>
214</varlistentry>
215
216<varlistentry id="rview">
217<term><command>rview</command></term>
218<listitem>
219<para>Is a restricted version of <command>view</command>; no shell
220commands can be started and <command>view</command> cannot be suspended</para>
221<indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
222</listitem>
223</varlistentry>
224
225<varlistentry id="rvim">
226<term><command>rvim</command></term>
227<listitem>
228<para>Is a restricted version of <command>vim</command>; no shell
229commands can be started and <command>vim</command> cannot be suspended</para>
230<indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
231</listitem>
232</varlistentry>
233
234<varlistentry id="shtags.pl">
235<term><command>shtags.pl</command></term>
236<listitem>
237<para>Generates a tags file for Perl scripts</para>
238<indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
239</listitem>
240</varlistentry>
241
242<varlistentry id="tcltags">
243<term><command>tcltags</command></term>
244<listitem>
245<para>Generates a tags file for TCL code</para>
246<indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
247</listitem>
248</varlistentry>
249
250<varlistentry id="view">
251<term><command>view</command></term>
252<listitem>
253<para>Starts <command>vim</command> in read-only mode</para>
254<indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
255</listitem>
256</varlistentry>
257
258<varlistentry id="vi">
259<term><command>vi</command></term>
260<listitem>
261<para>Is the editor</para>
262<indexterm zone="ch-system-vim vi"><primary sortas="b-vi">vi</primary></indexterm>
263</listitem>
264</varlistentry>
265
266<varlistentry id="vim">
267<term><command>vim</command></term>
268<listitem>
269<para>Is the editor</para>
270<indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
271</listitem>
272</varlistentry>
273
274<varlistentry id="vim132">
275<term><command>vim132</command></term>
276<listitem>
277<para>Starts <command>vim</command> with the terminal in 132-column mode</para>
278<indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
279</listitem>
280</varlistentry>
281
282<varlistentry id="vim2html.pl">
283<term><command>vim2html.pl</command></term>
284<listitem>
285<para>Converts Vim documentation to HypterText Markup Language (HTML)</para>
286<indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
287</listitem>
288</varlistentry>
289
290<varlistentry id="vimdiff">
291<term><command>vimdiff</command></term>
292<listitem>
293<para>Edits two or three versions of a file with <command>vim</command> and show differences</para>
294<indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
295</listitem>
296</varlistentry>
297
298<varlistentry id="vimm">
299<term><command>vimm</command></term>
300<listitem>
301<para>Enables the DEC locator input model on a remote terminal</para>
302<indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
303</listitem>
304</varlistentry>
305
306<varlistentry id="vimspell.sh">
307<term><command>vimspell.sh</command></term>
308<listitem>
309<para>Spell checks a file and generates the syntax statements necessary to
310highlight in <command>vim</command>. This script requires the old Unix
311<command>spell</command> command, which is provided neither in LFS nor in
312BLFS</para>
313<indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
314</listitem>
315</varlistentry>
316
317<varlistentry id="vimtutor">
318<term><command>vimtutor</command></term>
319<listitem>
320<para>Teaches the basic keys and commands of <command>vim</command></para>
321<indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
322</listitem>
323</varlistentry>
324
325<varlistentry id="xxd">
326<term><command>xxd</command></term>
327<listitem>
328<para>Creates a hex dump of the given file; it can
329also do the reverse, so it can be used for binary patching</para>
330<indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
331</listitem>
332</varlistentry>
333</variablelist>
334
335</sect2>
336
337</sect1>
338
Note: See TracBrowser for help on using the repository browser.