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 | <!ENTITY % patches-entities SYSTEM "../../patches.ent">
|
---|
6 | %general-entities;
|
---|
7 | %patches-entities;
|
---|
8 | ]>
|
---|
9 |
|
---|
10 | <sect1 id="ch-system-vim" role="wrap">
|
---|
11 | <?dbhtml filename="vim.html"?>
|
---|
12 |
|
---|
13 | <title>Vim-&vim-version;</title>
|
---|
14 |
|
---|
15 | <indexterm zone="ch-system-vim">
|
---|
16 | <primary sortas="a-Vim">Vim</primary>
|
---|
17 | </indexterm>
|
---|
18 |
|
---|
19 | <sect2 role="package">
|
---|
20 | <title/>
|
---|
21 |
|
---|
22 | <para>The Vim package contains a powerful text editor.</para>
|
---|
23 |
|
---|
24 | <segmentedlist>
|
---|
25 | <segtitle>&buildtime;</segtitle>
|
---|
26 | <segtitle>&diskspace;</segtitle>
|
---|
27 |
|
---|
28 | <seglistitem>
|
---|
29 | <seg>Not checked yet</seg>
|
---|
30 | <seg>Not checked yet</seg>
|
---|
31 | </seglistitem>
|
---|
32 | </segmentedlist>
|
---|
33 |
|
---|
34 | <segmentedlist>
|
---|
35 | <segtitle>&dependencies;</segtitle>
|
---|
36 |
|
---|
37 | <seglistitem>
|
---|
38 | <seg>Bash, Binutils, Coreutils, Diffutils,
|
---|
39 | GCC, Glibc, Grep, Make, Ncurses, and Sed</seg>
|
---|
40 | </seglistitem>
|
---|
41 | </segmentedlist>
|
---|
42 |
|
---|
43 | <tip>
|
---|
44 | <title>Alternatives to Vim</title>
|
---|
45 |
|
---|
46 | <para>If you prefer another editor—such as Emacs, Joe, or
|
---|
47 | Nano—please refer to <ulink
|
---|
48 | url="&blfs-root;view/svn/postlfs/editors.html"/>
|
---|
49 | for suggested installation instructions.</para>
|
---|
50 | </tip>
|
---|
51 |
|
---|
52 | </sect2>
|
---|
53 |
|
---|
54 | <sect2 role="installation">
|
---|
55 | <title>Installation of Vim</title>
|
---|
56 |
|
---|
57 | <para os="a">First, unpack both <filename>vim-&vim-version;.tar.bz2</filename>
|
---|
58 | and (optionally) <filename>vim-&vim-version;-lang.tar.gz</filename>
|
---|
59 | archives into the same directory. Then, change the default location of
|
---|
60 | the <filename>vimrc</filename> configuration file to <filename
|
---|
61 | class="directory">/etc</filename>:</para>
|
---|
62 |
|
---|
63 | <screen os="b"><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h</userinput></screen>
|
---|
64 |
|
---|
65 | <para os="e">Prepare Vim for compilation:</para>
|
---|
66 |
|
---|
67 | <screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
|
---|
68 |
|
---|
69 | <variablelist os="f">
|
---|
70 | <title>The meaning of the configure options:</title>
|
---|
71 |
|
---|
72 | <varlistentry>
|
---|
73 | <term><parameter>--enable-multibyte</parameter></term>
|
---|
74 | <listitem>
|
---|
75 | <para>This optional but highly recommended switch enables support
|
---|
76 | for editing files in multibyte character encodings. This is needed
|
---|
77 | if using a locale with a multibyte character set. This switch is
|
---|
78 | also helpful to be able to edit text files initially created in
|
---|
79 | Linux distributions like Fedora Core that use UTF-8 as a default
|
---|
80 | character set.</para>
|
---|
81 | </listitem>
|
---|
82 | </varlistentry>
|
---|
83 |
|
---|
84 | </variablelist>
|
---|
85 |
|
---|
86 | <para os="g">Compile the package:</para>
|
---|
87 |
|
---|
88 | <screen os="h"><userinput>make</userinput></screen>
|
---|
89 |
|
---|
90 | <para os="i">To test the results, issue: <userinput>make test</userinput>.
|
---|
91 | However, this test suite outputs a lot of binary data to the
|
---|
92 | screen, which can cause issues with the settings of the current terminal.
|
---|
93 | This can be resolved by redirecting the output to a log file.</para>
|
---|
94 |
|
---|
95 | <para os="j">Install the package:</para>
|
---|
96 |
|
---|
97 | <screen os="k"><userinput>make HELPSUBLOC=/usr/share/doc/vim-&vim-version; install</userinput></screen>
|
---|
98 |
|
---|
99 | <variablelist os="k1">
|
---|
100 | <title>The meaning of the make option:</title>
|
---|
101 |
|
---|
102 | <varlistentry>
|
---|
103 | <term><parameter>HELPSUBLOC=/usr/share/doc/vim-&vim-version;</parameter>
|
---|
104 | </term>
|
---|
105 | <listitem>
|
---|
106 | <para>This defines the directory that Vim's documentation will be
|
---|
107 | installed in. By default, Vim's documentation is installed in the
|
---|
108 | <filename class="directory">/usr/share/vim</filename> hierarchy. Other
|
---|
109 | packages install their documentation in the
|
---|
110 | <filename class="directory">/usr/share/doc</filename> hierarchy, so the
|
---|
111 | <parameter>HELPSUBLOC</parameter> option is used to ensure consistency.
|
---|
112 | </para>
|
---|
113 | </listitem>
|
---|
114 | </varlistentry>
|
---|
115 |
|
---|
116 | </variablelist>
|
---|
117 |
|
---|
118 | <para os="l">Many users are used to using <command>vi</command> instead of
|
---|
119 | <command>vim</command>. To allow execution of <command>vim</command>
|
---|
120 | when users habitually enter <command>vi</command>, create a
|
---|
121 | symlink:</para>
|
---|
122 |
|
---|
123 | <screen os="m"><userinput>ln -s vim /usr/bin/vi</userinput></screen>
|
---|
124 |
|
---|
125 | <para os="n">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/vim">/etc/vim</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
|
---|
149 | default <command>vim</command> configuration file by running the
|
---|
150 | following:</para>
|
---|
151 |
|
---|
152 | <screen><userinput>cat > /etc/vimrc << "EOF"
|
---|
153 | <literal>" Begin /etc/vimrc
|
---|
154 |
|
---|
155 | set nocompatible
|
---|
156 | set backspace=2
|
---|
157 | syntax on
|
---|
158 | if (&term == "iterm") || (&term == "putty")
|
---|
159 | set background=dark
|
---|
160 | endif
|
---|
161 |
|
---|
162 | " End /etc/vimrc</literal>
|
---|
163 | EOF</userinput></screen>
|
---|
164 |
|
---|
165 |
|
---|
166 | <para>The <parameter>set nocompatible</parameter> makes
|
---|
167 | <command>vim</command> behave in a more useful way (the default) than
|
---|
168 | the vi-compatible manner. Remove the <quote>no</quote> to keep the
|
---|
169 | old <command>vi</command> behavior. The <parameter>set
|
---|
170 | backspace=2</parameter> allows backspacing over line breaks,
|
---|
171 | autoindents, and the start of insert. The <parameter>syntax
|
---|
172 | on</parameter> enables vim's syntax highlighting. Finally, the
|
---|
173 | <emphasis>if</emphasis> statement with the <parameter>set
|
---|
174 | background=dark</parameter> corrects <command>vim</command>'s guess
|
---|
175 | about the background color of some terminal emulators. This gives the
|
---|
176 | highlighting a better color scheme for use on the black background of
|
---|
177 | these programs.</para>
|
---|
178 |
|
---|
179 | <para>Documentation for other available options can be obtained by
|
---|
180 | running the following command:</para>
|
---|
181 |
|
---|
182 | <screen><userinput>vim -c ':options'</userinput></screen>
|
---|
183 |
|
---|
184 | </sect2>
|
---|
185 |
|
---|
186 | <sect2 id="contents-vim" role="content">
|
---|
187 | <title>Contents of Vim</title>
|
---|
188 |
|
---|
189 | <segmentedlist>
|
---|
190 | <segtitle>Installed programs</segtitle>
|
---|
191 |
|
---|
192 | <seglistitem>
|
---|
193 | <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
|
---|
194 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
|
---|
195 | tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
|
---|
196 | vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg>
|
---|
197 | </seglistitem>
|
---|
198 | </segmentedlist>
|
---|
199 |
|
---|
200 | <variablelist>
|
---|
201 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
202 | <?dbfo list-presentation="list"?>
|
---|
203 | <?dbhtml list-presentation="table"?>
|
---|
204 |
|
---|
205 | <varlistentry id="efm_filter.pl">
|
---|
206 | <term><command>efm_filter.pl</command></term>
|
---|
207 | <listitem>
|
---|
208 | <para>A filter for creating an error file that can be read
|
---|
209 | by <command>vim</command></para>
|
---|
210 | <indexterm zone="ch-system-vim efm_filter.pl">
|
---|
211 | <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
|
---|
212 | </indexterm>
|
---|
213 | </listitem>
|
---|
214 | </varlistentry>
|
---|
215 |
|
---|
216 | <varlistentry id="efm_perl.pl">
|
---|
217 | <term><command>efm_perl.pl</command></term>
|
---|
218 | <listitem>
|
---|
219 | <para>Reformats the error messages of the Perl interpreter for use
|
---|
220 | with the <quote>quickfix</quote> mode of <command>vim</command></para>
|
---|
221 | <indexterm zone="ch-system-vim efm_perl.pl">
|
---|
222 | <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
|
---|
223 | </indexterm>
|
---|
224 | </listitem>
|
---|
225 | </varlistentry>
|
---|
226 |
|
---|
227 | <varlistentry id="ex">
|
---|
228 | <term><command>ex</command></term>
|
---|
229 | <listitem>
|
---|
230 | <para>Starts <command>vim</command> in ex mode</para>
|
---|
231 | <indexterm zone="ch-system-vim ex">
|
---|
232 | <primary sortas="b-ex">ex</primary>
|
---|
233 | </indexterm>
|
---|
234 | </listitem>
|
---|
235 | </varlistentry>
|
---|
236 |
|
---|
237 | <varlistentry id="less.sh">
|
---|
238 | <term><command>less.sh</command></term>
|
---|
239 | <listitem>
|
---|
240 | <para>A script that starts <command>vim</command> with less.vim</para>
|
---|
241 | <indexterm zone="ch-system-vim less.sh">
|
---|
242 | <primary sortas="b-less.sh">less.sh</primary>
|
---|
243 | </indexterm>
|
---|
244 | </listitem>
|
---|
245 | </varlistentry>
|
---|
246 |
|
---|
247 | <varlistentry id="mve.awk">
|
---|
248 | <term><command>mve.awk</command></term>
|
---|
249 | <listitem>
|
---|
250 | <para>Processes <command>vim</command> errors</para>
|
---|
251 | <indexterm zone="ch-system-vim mve.awk">
|
---|
252 | <primary sortas="b-mve.awk">mve.awk</primary>
|
---|
253 | </indexterm>
|
---|
254 | </listitem>
|
---|
255 | </varlistentry>
|
---|
256 |
|
---|
257 | <varlistentry id="pltags.pl">
|
---|
258 | <term><command>pltags.pl</command></term>
|
---|
259 | <listitem>
|
---|
260 | <para>Creates a tags file for Perl code for use by
|
---|
261 | <command>vim</command></para>
|
---|
262 | <indexterm zone="ch-system-vim pltags.pl">
|
---|
263 | <primary sortas="b-pltags.pl">pltags.pl</primary>
|
---|
264 | </indexterm>
|
---|
265 | </listitem>
|
---|
266 | </varlistentry>
|
---|
267 |
|
---|
268 | <varlistentry id="ref">
|
---|
269 | <term><command>ref</command></term>
|
---|
270 | <listitem>
|
---|
271 | <para>Checks the spelling of arguments</para>
|
---|
272 | <indexterm zone="ch-system-vim ref">
|
---|
273 | <primary sortas="b-ref">ref</primary>
|
---|
274 | </indexterm>
|
---|
275 | </listitem>
|
---|
276 | </varlistentry>
|
---|
277 |
|
---|
278 | <varlistentry id="rview">
|
---|
279 | <term><command>rview</command></term>
|
---|
280 | <listitem>
|
---|
281 | <para>Is a restricted version of <command>view</command>; no shell
|
---|
282 | commands can be started and <command>view</command> cannot be
|
---|
283 | suspended</para>
|
---|
284 | <indexterm zone="ch-system-vim rview">
|
---|
285 | <primary sortas="b-rview">rview</primary>
|
---|
286 | </indexterm>
|
---|
287 | </listitem>
|
---|
288 | </varlistentry>
|
---|
289 |
|
---|
290 | <varlistentry id="rvim">
|
---|
291 | <term><command>rvim</command></term>
|
---|
292 | <listitem>
|
---|
293 | <para>Is a restricted version of <command>vim</command>; no shell
|
---|
294 | commands can be started and <command>vim</command> cannot be
|
---|
295 | suspended</para>
|
---|
296 | <indexterm zone="ch-system-vim rvim">
|
---|
297 | <primary sortas="b-rvim">rvim</primary>
|
---|
298 | </indexterm>
|
---|
299 | </listitem>
|
---|
300 | </varlistentry>
|
---|
301 |
|
---|
302 | <varlistentry id="shtags.pl">
|
---|
303 | <term><command>shtags.pl</command></term>
|
---|
304 | <listitem>
|
---|
305 | <para>Generates a tags file for Perl scripts</para>
|
---|
306 | <indexterm zone="ch-system-vim shtags.pl">
|
---|
307 | <primary sortas="b-shtags.pl">shtags.pl</primary>
|
---|
308 | </indexterm>
|
---|
309 | </listitem>
|
---|
310 | </varlistentry>
|
---|
311 |
|
---|
312 | <varlistentry id="tcltags">
|
---|
313 | <term><command>tcltags</command></term>
|
---|
314 | <listitem>
|
---|
315 | <para>Generates a tags file for TCL code</para>
|
---|
316 | <indexterm zone="ch-system-vim tcltags">
|
---|
317 | <primary sortas="b-tcltags">tcltags</primary>
|
---|
318 | </indexterm>
|
---|
319 | </listitem>
|
---|
320 | </varlistentry>
|
---|
321 |
|
---|
322 | <varlistentry id="view">
|
---|
323 | <term><command>view</command></term>
|
---|
324 | <listitem>
|
---|
325 | <para>Starts <command>vim</command> in read-only mode</para>
|
---|
326 | <indexterm zone="ch-system-vim view">
|
---|
327 | <primary sortas="b-view">view</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="vim">
|
---|
343 | <term><command>vim</command></term>
|
---|
344 | <listitem>
|
---|
345 | <para>Is the editor</para>
|
---|
346 | <indexterm zone="ch-system-vim vim">
|
---|
347 | <primary sortas="b-vim">vim</primary>
|
---|
348 | </indexterm>
|
---|
349 | </listitem>
|
---|
350 | </varlistentry>
|
---|
351 |
|
---|
352 | <varlistentry id="vim132">
|
---|
353 | <term><command>vim132</command></term>
|
---|
354 | <listitem>
|
---|
355 | <para>Starts <command>vim</command> with the terminal in 132-column
|
---|
356 | mode</para>
|
---|
357 | <indexterm zone="ch-system-vim vim132">
|
---|
358 | <primary sortas="b-vim132">vim132</primary>
|
---|
359 | </indexterm>
|
---|
360 | </listitem>
|
---|
361 | </varlistentry>
|
---|
362 |
|
---|
363 | <varlistentry id="vim2html.pl">
|
---|
364 | <term><command>vim2html.pl</command></term>
|
---|
365 | <listitem>
|
---|
366 | <para>Converts Vim documentation to HypterText Markup Language
|
---|
367 | (HTML)</para>
|
---|
368 | <indexterm zone="ch-system-vim vim2html.pl">
|
---|
369 | <primary sortas="b-vim2html.pl">vim2html.pl</primary>
|
---|
370 | </indexterm>
|
---|
371 | </listitem>
|
---|
372 | </varlistentry>
|
---|
373 |
|
---|
374 | <varlistentry id="vimdiff">
|
---|
375 | <term><command>vimdiff</command></term>
|
---|
376 | <listitem>
|
---|
377 | <para>Edits two or three versions of a file with <command>vim</command>
|
---|
378 | and show differences</para>
|
---|
379 | <indexterm zone="ch-system-vim vimdiff">
|
---|
380 | <primary sortas="b-vimdiff">vimdiff</primary>
|
---|
381 | </indexterm>
|
---|
382 | </listitem>
|
---|
383 | </varlistentry>
|
---|
384 |
|
---|
385 | <varlistentry id="vimm">
|
---|
386 | <term><command>vimm</command></term>
|
---|
387 | <listitem>
|
---|
388 | <para>Enables the DEC locator input model on a remote terminal</para>
|
---|
389 | <indexterm zone="ch-system-vim vimm">
|
---|
390 | <primary sortas="b-vimm">vimm</primary>
|
---|
391 | </indexterm>
|
---|
392 | </listitem>
|
---|
393 | </varlistentry>
|
---|
394 |
|
---|
395 | <varlistentry id="vimspell.sh">
|
---|
396 | <term><command>vimspell.sh</command></term>
|
---|
397 | <listitem>
|
---|
398 | <para>Spell checks a file and generates the syntax statements
|
---|
399 | necessary to highlight in <command>vim</command>. This script
|
---|
400 | requires the old Unix <command>spell</command> command, which
|
---|
401 | is provided neither in LFS nor in BLFS</para>
|
---|
402 | <indexterm zone="ch-system-vim vimspell.sh">
|
---|
403 | <primary sortas="b-vimspell.sh">vimspell.sh</primary>
|
---|
404 | </indexterm>
|
---|
405 | </listitem>
|
---|
406 | </varlistentry>
|
---|
407 |
|
---|
408 | <varlistentry id="vimtutor">
|
---|
409 | <term><command>vimtutor</command></term>
|
---|
410 | <listitem>
|
---|
411 | <para>Teaches the basic keys and commands of
|
---|
412 | <command>vim</command></para>
|
---|
413 | <indexterm zone="ch-system-vim vimtutor">
|
---|
414 | <primary sortas="b-vimtutor">vimtutor</primary>
|
---|
415 | </indexterm>
|
---|
416 | </listitem>
|
---|
417 | </varlistentry>
|
---|
418 |
|
---|
419 | <varlistentry id="xxd">
|
---|
420 | <term><command>xxd</command></term>
|
---|
421 | <listitem>
|
---|
422 | <para>Creates a hex dump of the given file; it can
|
---|
423 | also do the reverse, so it can be used for binary patching</para>
|
---|
424 | <indexterm zone="ch-system-vim xxd">
|
---|
425 | <primary sortas="b-xxd">xxd</primary>
|
---|
426 | </indexterm>
|
---|
427 | </listitem>
|
---|
428 | </varlistentry>
|
---|
429 |
|
---|
430 | </variablelist>
|
---|
431 |
|
---|
432 | </sect2>
|
---|
433 |
|
---|
434 | </sect1>
|
---|