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—such as Emacs, Joe, or
|
---|
36 | Nano—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>This version of Vim installs translated man pages and places
|
---|
52 | them into directories that will not be searched by Man-DB. Patch Vim
|
---|
53 | so that it installs its man pages into searchable directories and
|
---|
54 | ultimately allows Man-DB to transcode the page into the desired format
|
---|
55 | at run-time:</para>
|
---|
56 |
|
---|
57 | <screen><userinput>patch -Np1 -i ../&vim-mandir-patch;</userinput></screen>
|
---|
58 |
|
---|
59 | <para>Finally, change the default location of the
|
---|
60 | <filename>vimrc</filename> configuration file to <filename
|
---|
61 | class="directory">/etc</filename>:</para>
|
---|
62 |
|
---|
63 | <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h</userinput></screen>
|
---|
64 |
|
---|
65 | <para>Now prepare Vim for compilation:</para>
|
---|
66 |
|
---|
67 | <screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
|
---|
68 |
|
---|
69 | <variablelist>
|
---|
70 | <title>The meaning of the configure options:</title>
|
---|
71 |
|
---|
72 | <varlistentry>
|
---|
73 | <term><parameter>--enable-multibyte</parameter></term>
|
---|
74 | <listitem>
|
---|
75 | <para>This switch enables support for editing files in multibyte
|
---|
76 | character encodings. This is needed if using a locale with a
|
---|
77 | multibyte character set. This switch is also helpful to be able
|
---|
78 | to edit text files initially created in Linux distributions like
|
---|
79 | Fedora Core that use UTF-8 as a default character set.</para>
|
---|
80 | </listitem>
|
---|
81 | </varlistentry>
|
---|
82 |
|
---|
83 | </variablelist>
|
---|
84 |
|
---|
85 | <para>Compile the package:</para>
|
---|
86 |
|
---|
87 | <screen><userinput>make</userinput></screen>
|
---|
88 |
|
---|
89 | <para>To test the results, issue: <userinput>make test</userinput>. However,
|
---|
90 | this test suite outputs a lot of binary data to the screen, which can cause
|
---|
91 | issues with the settings of the current terminal. This can be resolved by
|
---|
92 | redirecting the output to a log file.</para>
|
---|
93 |
|
---|
94 | <para>Install the package:</para>
|
---|
95 |
|
---|
96 | <screen><userinput>make install</userinput></screen>
|
---|
97 |
|
---|
98 | <para>Many users are used to using <command>vi</command> instead of
|
---|
99 | <command>vim</command>. To allow execution of <command>vim</command>
|
---|
100 | when users habitually enter <command>vi</command>, create a
|
---|
101 | symlink for both the binary and the man page in the provided
|
---|
102 | languages:</para>
|
---|
103 |
|
---|
104 | <screen><userinput>ln -sv vim /usr/bin/vi
|
---|
105 | for L in "" fr it pl ru; do
|
---|
106 | ln -sv vim.1 /usr/share/man/$L/man1/vi.1
|
---|
107 | done</userinput></screen>
|
---|
108 |
|
---|
109 | <para>By default, Vim's documentation is installed in <filename
|
---|
110 | class="directory">/usr/share/vim</filename>. The following symlink
|
---|
111 | allows the documentation to be accessed via <filename
|
---|
112 | class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
|
---|
113 | it consistent with the location of documentation for other packages:</para>
|
---|
114 |
|
---|
115 | <screen><userinput>ln -sv ../vim/vim70/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
|
---|
116 |
|
---|
117 | <para>If an X Window System is going to be installed on the LFS
|
---|
118 | system, it may be necessary to recompile Vim after installing X. Vim
|
---|
119 | comes with a GUI version of the editor that requires X and some
|
---|
120 | additional libraries to be installed. For more information on this
|
---|
121 | process, refer to the Vim documentation and the Vim installation page
|
---|
122 | in the BLFS book at <ulink
|
---|
123 | url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
|
---|
124 |
|
---|
125 | </sect2>
|
---|
126 |
|
---|
127 | <sect2 id="conf-vim" role="configuration">
|
---|
128 | <title>Configuring Vim</title>
|
---|
129 |
|
---|
130 | <indexterm zone="conf-vim">
|
---|
131 | <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
|
---|
132 | </indexterm>
|
---|
133 |
|
---|
134 | <para>By default, <command>vim</command> runs in vi-incompatible mode.
|
---|
135 | This may be new to users who have used other editors in the past. The
|
---|
136 | <quote>nocompatible</quote> setting is included below to highlight the
|
---|
137 | fact that a new behavior is being used. It also reminds those who would
|
---|
138 | change to <quote>compatible</quote> mode that it should be the first
|
---|
139 | setting in the configuration file. This is necessary because it changes
|
---|
140 | other settings, and overrides must come after this setting. Create a default
|
---|
141 | <command>vim</command> configuration file by running the following:</para>
|
---|
142 |
|
---|
143 | <screen><userinput>cat > /etc/vimrc << "EOF"
|
---|
144 | <literal>" Begin /etc/vimrc
|
---|
145 |
|
---|
146 | set nocompatible
|
---|
147 | set backspace=2
|
---|
148 | syntax on
|
---|
149 | if (&term == "iterm") || (&term == "putty")
|
---|
150 | set background=dark
|
---|
151 | endif
|
---|
152 |
|
---|
153 | " End /etc/vimrc</literal>
|
---|
154 | EOF</userinput></screen>
|
---|
155 |
|
---|
156 | <para>The <parameter>set nocompatible</parameter> setting makes
|
---|
157 | <command>vim</command> behave in a more useful way (the default) than
|
---|
158 | the vi-compatible manner. Remove the <quote>no</quote> to keep the
|
---|
159 | old <command>vi</command> behavior. The <parameter>set
|
---|
160 | backspace=2</parameter> setting allows backspacing over line breaks,
|
---|
161 | autoindents, and the start of insert. The <parameter>syntax
|
---|
162 | on</parameter> parameter enables vim's syntax highlighting. Finally,
|
---|
163 | the <emphasis>if</emphasis> statement with the <parameter>set
|
---|
164 | background=dark</parameter> setting corrects <command>vim</command>'s
|
---|
165 | guess about the background color of some terminal emulators. This
|
---|
166 | gives the highlighting a better color scheme for use on the black
|
---|
167 | background of these programs.</para>
|
---|
168 |
|
---|
169 | <para>Documentation for other available options can be obtained by
|
---|
170 | running the following command:</para>
|
---|
171 |
|
---|
172 | <screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
|
---|
173 |
|
---|
174 | <note>
|
---|
175 | <para>By default, Vim only installs spell files for the English language.
|
---|
176 | To install spell files for your preferred language, download the
|
---|
177 | <filename>*.spl</filename> and optionally, the <filename>*.sug</filename>
|
---|
178 | files for your language and character encoding from <ulink
|
---|
179 | url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save them to
|
---|
180 | <filename class='directory'>/usr/share/vim/vim70/spell/</filename>.</para>
|
---|
181 |
|
---|
182 | <para>To use these spell files, some configuration in
|
---|
183 | <filename>/etc/vimrc</filename> is needed, e.g.:</para>
|
---|
184 |
|
---|
185 | <screen><literal>set spelllang=en,ru
|
---|
186 | set spell</literal></screen>
|
---|
187 |
|
---|
188 | <para>For more information, see the appropriate README file located
|
---|
189 | at the URL above.</para>
|
---|
190 | </note>
|
---|
191 |
|
---|
192 | </sect2>
|
---|
193 |
|
---|
194 | <sect2 id="contents-vim" role="content">
|
---|
195 | <title>Contents of Vim</title>
|
---|
196 |
|
---|
197 | <segmentedlist>
|
---|
198 | <segtitle>Installed programs</segtitle>
|
---|
199 |
|
---|
200 | <seglistitem>
|
---|
201 | <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
|
---|
202 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
|
---|
203 | vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
|
---|
204 | vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg>
|
---|
205 | </seglistitem>
|
---|
206 | </segmentedlist>
|
---|
207 |
|
---|
208 | <variablelist>
|
---|
209 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
210 | <?dbfo list-presentation="list"?>
|
---|
211 | <?dbhtml list-presentation="table"?>
|
---|
212 |
|
---|
213 | <varlistentry id="efm_filter.pl">
|
---|
214 | <term><command>efm_filter.pl</command></term>
|
---|
215 | <listitem>
|
---|
216 | <para>A filter for creating an error file that can be read
|
---|
217 | by <command>vim</command></para>
|
---|
218 | <indexterm zone="ch-system-vim efm_filter.pl">
|
---|
219 | <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
|
---|
220 | </indexterm>
|
---|
221 | </listitem>
|
---|
222 | </varlistentry>
|
---|
223 |
|
---|
224 | <varlistentry id="efm_perl.pl">
|
---|
225 | <term><command>efm_perl.pl</command></term>
|
---|
226 | <listitem>
|
---|
227 | <para>Reformats the error messages of the Perl interpreter for use
|
---|
228 | with the <quote>quickfix</quote> mode of <command>vim</command></para>
|
---|
229 | <indexterm zone="ch-system-vim efm_perl.pl">
|
---|
230 | <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
|
---|
231 | </indexterm>
|
---|
232 | </listitem>
|
---|
233 | </varlistentry>
|
---|
234 |
|
---|
235 | <varlistentry id="ex">
|
---|
236 | <term><command>ex</command></term>
|
---|
237 | <listitem>
|
---|
238 | <para>Starts <command>vim</command> in ex mode</para>
|
---|
239 | <indexterm zone="ch-system-vim ex">
|
---|
240 | <primary sortas="b-ex">ex</primary>
|
---|
241 | </indexterm>
|
---|
242 | </listitem>
|
---|
243 | </varlistentry>
|
---|
244 |
|
---|
245 | <varlistentry id="less.sh">
|
---|
246 | <term><command>less.sh</command></term>
|
---|
247 | <listitem>
|
---|
248 | <para>A script that starts <command>vim</command> with less.vim</para>
|
---|
249 | <indexterm zone="ch-system-vim less.sh">
|
---|
250 | <primary sortas="b-less.sh">less.sh</primary>
|
---|
251 | </indexterm>
|
---|
252 | </listitem>
|
---|
253 | </varlistentry>
|
---|
254 |
|
---|
255 | <varlistentry id="mve.awk">
|
---|
256 | <term><command>mve.awk</command></term>
|
---|
257 | <listitem>
|
---|
258 | <para>Processes <command>vim</command> errors</para>
|
---|
259 | <indexterm zone="ch-system-vim mve.awk">
|
---|
260 | <primary sortas="b-mve.awk">mve.awk</primary>
|
---|
261 | </indexterm>
|
---|
262 | </listitem>
|
---|
263 | </varlistentry>
|
---|
264 |
|
---|
265 | <varlistentry id="pltags.pl">
|
---|
266 | <term><command>pltags.pl</command></term>
|
---|
267 | <listitem>
|
---|
268 | <para>Creates a tags file for Perl code for use by
|
---|
269 | <command>vim</command></para>
|
---|
270 | <indexterm zone="ch-system-vim pltags.pl">
|
---|
271 | <primary sortas="b-pltags.pl">pltags.pl</primary>
|
---|
272 | </indexterm>
|
---|
273 | </listitem>
|
---|
274 | </varlistentry>
|
---|
275 |
|
---|
276 | <varlistentry id="ref">
|
---|
277 | <term><command>ref</command></term>
|
---|
278 | <listitem>
|
---|
279 | <para>Checks the spelling of arguments</para>
|
---|
280 | <indexterm zone="ch-system-vim ref">
|
---|
281 | <primary sortas="b-ref">ref</primary>
|
---|
282 | </indexterm>
|
---|
283 | </listitem>
|
---|
284 | </varlistentry>
|
---|
285 |
|
---|
286 | <varlistentry id="rview">
|
---|
287 | <term><command>rview</command></term>
|
---|
288 | <listitem>
|
---|
289 | <para>Is a restricted version of <command>view</command>; no shell
|
---|
290 | commands can be started and <command>view</command> cannot be
|
---|
291 | suspended</para>
|
---|
292 | <indexterm zone="ch-system-vim rview">
|
---|
293 | <primary sortas="b-rview">rview</primary>
|
---|
294 | </indexterm>
|
---|
295 | </listitem>
|
---|
296 | </varlistentry>
|
---|
297 |
|
---|
298 | <varlistentry id="rvim">
|
---|
299 | <term><command>rvim</command></term>
|
---|
300 | <listitem>
|
---|
301 | <para>Is a restricted version of <command>vim</command>; no shell
|
---|
302 | commands can be started and <command>vim</command> cannot be
|
---|
303 | suspended</para>
|
---|
304 | <indexterm zone="ch-system-vim rvim">
|
---|
305 | <primary sortas="b-rvim">rvim</primary>
|
---|
306 | </indexterm>
|
---|
307 | </listitem>
|
---|
308 | </varlistentry>
|
---|
309 |
|
---|
310 | <varlistentry id="shtags.pl">
|
---|
311 | <term><command>shtags.pl</command></term>
|
---|
312 | <listitem>
|
---|
313 | <para>Generates a tags file for Perl scripts</para>
|
---|
314 | <indexterm zone="ch-system-vim shtags.pl">
|
---|
315 | <primary sortas="b-shtags.pl">shtags.pl</primary>
|
---|
316 | </indexterm>
|
---|
317 | </listitem>
|
---|
318 | </varlistentry>
|
---|
319 |
|
---|
320 | <varlistentry id="vi">
|
---|
321 | <term><command>vi</command></term>
|
---|
322 | <listitem>
|
---|
323 | <para>Link to <command>vim</command></para>
|
---|
324 | <indexterm zone="ch-system-vim vi">
|
---|
325 | <primary sortas="b-vi">vi</primary>
|
---|
326 | </indexterm>
|
---|
327 | </listitem>
|
---|
328 | </varlistentry>
|
---|
329 |
|
---|
330 | <varlistentry id="view">
|
---|
331 | <term><command>view</command></term>
|
---|
332 | <listitem>
|
---|
333 | <para>Starts <command>vim</command> in read-only mode</para>
|
---|
334 | <indexterm zone="ch-system-vim view">
|
---|
335 | <primary sortas="b-view">view</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>
|
---|