1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE section [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 | <section xmlns="http://docbook.org/docbook-ng"
|
---|
7 | xmlns:xlink="http://www.w3.org/1999/xlink"
|
---|
8 | xml:id="ch-system-vim" xreflabel="Vim" role="wrap">
|
---|
9 | <title>Vim-&vim-version;</title>
|
---|
10 | <?dbhtml filename="vim.html"?>
|
---|
11 |
|
---|
12 | <indexterm zone="ch-system-vim"><primary sortas="a-Vim">Vim</primary></indexterm>
|
---|
13 |
|
---|
14 | <section role="package"><title/>
|
---|
15 | <para>The Vim package contains a powerful text editor.</para>
|
---|
16 |
|
---|
17 | <segmentedlist>
|
---|
18 | <segtitle>&buildtime;</segtitle>
|
---|
19 | <segtitle>&diskspace;</segtitle>
|
---|
20 | <seglistitem><seg>0.4 SBU</seg><seg>34 MB</seg></seglistitem>
|
---|
21 | </segmentedlist>
|
---|
22 |
|
---|
23 | <segmentedlist>
|
---|
24 | <segtitle>Vim installation depends on</segtitle>
|
---|
25 | <seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
|
---|
26 | GCC, Glibc, Grep, Make, Ncurses, Sed</seg></seglistitem>
|
---|
27 | </segmentedlist>
|
---|
28 |
|
---|
29 | <tip>
|
---|
30 | <title>Alternatives to Vim</title>
|
---|
31 | <para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,
|
---|
32 | have a look at <uri xlink:href="&blfs-root;view/stable/postlfs/editors.html"/> for
|
---|
33 | suggested installation instructions.</para>
|
---|
34 | </tip>
|
---|
35 | </section>
|
---|
36 |
|
---|
37 | <section role="installation">
|
---|
38 | <title>Installation of Vim</title>
|
---|
39 |
|
---|
40 | <para>First, unpack both
|
---|
41 | <filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
|
---|
42 | <filename>vim-&vim-version;-lang.tar.gz</filename> archives into the same
|
---|
43 | directory. Then change the default locations of the <filename>vimrc</filename> and
|
---|
44 | <filename>gvimrc</filename> configuration files to <filename class="directory">/etc</filename>.</para>
|
---|
45 |
|
---|
46 | <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
|
---|
47 | echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h</userinput></screen>
|
---|
48 |
|
---|
49 | <para>Now prepare Vim for compilation:</para>
|
---|
50 |
|
---|
51 | <screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
|
---|
52 |
|
---|
53 | <para>The optional but highly recommended
|
---|
54 | <parameter>--enable-multibyte</parameter> switch
|
---|
55 | includes support for editing files in multibyte character encodings into
|
---|
56 | <command>vim</command>.
|
---|
57 | It is needed for those people who ignore our recommendation not to
|
---|
58 | use LFS in locales with multibyte character sets. It is also needed for
|
---|
59 | people who want to be able to edit text files initially created
|
---|
60 | in Linux distributions like Fedora Core
|
---|
61 | that use UTF-8 as a default character set.</para>
|
---|
62 |
|
---|
63 | <para>Compile the package:</para>
|
---|
64 |
|
---|
65 | <screen><userinput>make</userinput></screen>
|
---|
66 |
|
---|
67 | <para>To test the results, you can issue:
|
---|
68 | <userinput>make test</userinput>. However, this test suite outputs a lot of
|
---|
69 | seemingly garbage characters to the screen, and this can wreak havoc with the
|
---|
70 | settings of the current terminal. Therefore the running of the test suite here
|
---|
71 | is strictly optional.</para>
|
---|
72 |
|
---|
73 | <para>Now install the package:</para>
|
---|
74 |
|
---|
75 | <screen><userinput>make install</userinput></screen>
|
---|
76 |
|
---|
77 | <para>Many users are used to using <command>vi</command>, instead of
|
---|
78 | <command>vim</command>. To let them execute <command>vim</command> when
|
---|
79 | they habitually enter <command>vi</command>, create a symlink:</para>
|
---|
80 |
|
---|
81 | <screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
|
---|
82 |
|
---|
83 | <para>If you are going to install the X Window System on your LFS system, you
|
---|
84 | may want to re-compile Vim after having installed X. Vim comes with a nice GUI
|
---|
85 | version of the editor that requires X and a few other libraries to be
|
---|
86 | installed. For more information read the Vim documentation.</para>
|
---|
87 |
|
---|
88 | </section>
|
---|
89 |
|
---|
90 |
|
---|
91 | <section xml:id="conf-vim" role="configuration"><title>Configuring Vim</title>
|
---|
92 | <indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
|
---|
93 |
|
---|
94 | <para>By default, <command>vim</command> runs in vi-incompatible mode. Some
|
---|
95 | people might not like this, but we prefer to run <command>vim</command> in its
|
---|
96 | own mode (else we wouldn't have included it in this book, but the original
|
---|
97 | <command>vi</command>). We've included the setting of <quote>nocompatible</quote>
|
---|
98 | below to high-light the fact that the new behavior is being used. It
|
---|
99 | also reminds those who would change to <quote>compatible</quote> mode that it should
|
---|
100 | appear first because it changes other settings and overrides must come
|
---|
101 | after this setting. Create a default vim configuration file by running
|
---|
102 | the following:</para>
|
---|
103 |
|
---|
104 | <screen><userinput>cat > /etc/vimrc << "EOF"
|
---|
105 | " Begin /etc/vimrc
|
---|
106 |
|
---|
107 | set nocompatible
|
---|
108 | set backspace=2
|
---|
109 | syntax on
|
---|
110 | <!-- set fileencodings=ucs-bom,utf-8,<replaceable>[your-8-bit-charset]</replaceable> -->
|
---|
111 | if (&term == "iterm") || (&term == "putty")
|
---|
112 | set background=dark
|
---|
113 | endif
|
---|
114 |
|
---|
115 | " End /etc/vimrc
|
---|
116 | EOF</userinput></screen>
|
---|
117 |
|
---|
118 | <para>The <parameter>set nocompatible</parameter> makes
|
---|
119 | <command>vim</command> behave in a more useful way (the default) than the
|
---|
120 | vi-compatible manner. Remove the <quote>no</quote> if you want the old <command>vi</command>
|
---|
121 | behavior. The <parameter>set backspace=2</parameter> allows
|
---|
122 | backspacing over line breaks, autoindents and the start of insert. The
|
---|
123 | <parameter>syntax on</parameter> enables <command>vim</command>'s
|
---|
124 | syntax highliting.
|
---|
125 | <!-- XXX: the ascii-only files are considered to be in utf-8 - that's not what
|
---|
126 | one expects . That's why fileencodings stuff is commented out for now
|
---|
127 |
|
---|
128 | The <parameter>set fileencodings=...</parameter> makes
|
---|
129 | <command>vim</command> capable of automatically detecting the character
|
---|
130 | set of the file being edited (replace
|
---|
131 | "<replaceable>[your-8-bit-charset]</replaceable>"
|
---|
132 | with the value appropriate for your country, e.g. iso-8859-15 in Italy).
|
---|
133 | This line is useful because bleeding-edge distributions
|
---|
134 | like Fedora Core use UTF-8, and conservative ones like Debian
|
---|
135 | use traditional 8-bit encodings for text files. If you have not
|
---|
136 | passed the <parameter>- -enable-multibyte</parameter> switch to the
|
---|
137 | <command>./configure</command> command above, this line will not work. -->
|
---|
138 | Finally, the <emphasis>if</emphasis> statement with the
|
---|
139 | <parameter>set background=dark</parameter> corrects <command>vim</command>'s
|
---|
140 | guess about the background color of some terminal emulators. This gives the
|
---|
141 | highliting a better color scheme for use on the black background of
|
---|
142 | these programs.
|
---|
143 | </para>
|
---|
144 |
|
---|
145 | <para>Documentation for other available options can be obtained by running
|
---|
146 | the following command:</para>
|
---|
147 |
|
---|
148 | <screen><userinput>vim -c ':options'</userinput></screen>
|
---|
149 |
|
---|
150 | </section>
|
---|
151 |
|
---|
152 |
|
---|
153 | <section xml:id="contents-vim" role="content"><title>Contents of Vim</title>
|
---|
154 |
|
---|
155 | <segmentedlist>
|
---|
156 | <segtitle>Installed programs</segtitle>
|
---|
157 | <seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
|
---|
158 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
|
---|
159 | view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
|
---|
160 | vimtutor and xxd</seg></seglistitem>
|
---|
161 | </segmentedlist>
|
---|
162 |
|
---|
163 | <variablelist><title>Short descriptions</title>
|
---|
164 |
|
---|
165 | <varlistentry xml:id="efm_filter.pl">
|
---|
166 | <term><command>efm_filter.pl</command></term>
|
---|
167 | <listitem>
|
---|
168 | <indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
|
---|
169 | <para>is a filter for creating an error file that can be read by <command>vim</command>.</para>
|
---|
170 | </listitem>
|
---|
171 | </varlistentry>
|
---|
172 |
|
---|
173 | <varlistentry xml:id="efm_perl.pl">
|
---|
174 | <term><command>efm_perl.pl</command></term>
|
---|
175 | <listitem>
|
---|
176 | <indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
|
---|
177 | <para>reformats the error messages of the
|
---|
178 | Perl interpreter for use with the <quote>quickfix</quote> mode of <command>vim</command>.</para>
|
---|
179 | </listitem>
|
---|
180 | </varlistentry>
|
---|
181 |
|
---|
182 | <varlistentry xml:id="ex">
|
---|
183 | <term><command>ex</command></term>
|
---|
184 | <listitem>
|
---|
185 | <indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
|
---|
186 | <para>starts <command>vim</command> in ex mode.</para>
|
---|
187 | </listitem>
|
---|
188 | </varlistentry>
|
---|
189 |
|
---|
190 | <varlistentry xml:id="less.sh">
|
---|
191 | <term><command>less.sh</command></term>
|
---|
192 | <listitem>
|
---|
193 | <indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
|
---|
194 | <para>is a script that starts <command>vim</command> with less.vim.</para>
|
---|
195 | </listitem>
|
---|
196 | </varlistentry>
|
---|
197 |
|
---|
198 | <varlistentry xml:id="mve.awk">
|
---|
199 | <term><command>mve.awk</command></term>
|
---|
200 | <listitem>
|
---|
201 | <indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
|
---|
202 | <para>processes <command>vim</command> errors.</para>
|
---|
203 | </listitem>
|
---|
204 | </varlistentry>
|
---|
205 |
|
---|
206 | <varlistentry xml:id="pltags.pl">
|
---|
207 | <term><command>pltags.pl</command></term>
|
---|
208 | <listitem>
|
---|
209 | <indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
|
---|
210 | <para>creates a tags file for Perl code, for use by <command>vim</command>.</para>
|
---|
211 | </listitem>
|
---|
212 | </varlistentry>
|
---|
213 |
|
---|
214 | <varlistentry xml:id="ref">
|
---|
215 | <term><command>ref</command></term>
|
---|
216 | <listitem>
|
---|
217 | <indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
|
---|
218 | <para>checks the spelling of arguments.</para>
|
---|
219 | </listitem>
|
---|
220 | </varlistentry>
|
---|
221 |
|
---|
222 | <varlistentry xml:id="rview">
|
---|
223 | <term><command>rview</command></term>
|
---|
224 | <listitem>
|
---|
225 | <indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
|
---|
226 | <para>is a restricted version of <command>view</command>: no shell
|
---|
227 | commands can be started and <command>view</command> can't be suspended.</para>
|
---|
228 | </listitem>
|
---|
229 | </varlistentry>
|
---|
230 |
|
---|
231 | <varlistentry xml:id="rvim">
|
---|
232 | <term><command>rvim</command></term>
|
---|
233 | <listitem>
|
---|
234 | <indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
|
---|
235 | <para>is a restricted version of <command>vim</command>: no shell
|
---|
236 | commands can be started and <command>vim</command> can't be suspended.</para>
|
---|
237 | </listitem>
|
---|
238 | </varlistentry>
|
---|
239 |
|
---|
240 | <varlistentry xml:id="shtags.pl">
|
---|
241 | <term><command>shtags.pl</command></term>
|
---|
242 | <listitem>
|
---|
243 | <indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
|
---|
244 | <para>generates a tag file for Perl scripts.</para>
|
---|
245 | </listitem>
|
---|
246 | </varlistentry>
|
---|
247 |
|
---|
248 | <varlistentry xml:id="tcltags">
|
---|
249 | <term><command>tcltags</command></term>
|
---|
250 | <listitem>
|
---|
251 | <indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
|
---|
252 | <para>generates a tag file for TCL code.</para>
|
---|
253 | </listitem>
|
---|
254 | </varlistentry>
|
---|
255 |
|
---|
256 | <varlistentry xml:id="view">
|
---|
257 | <term><command>view</command></term>
|
---|
258 | <listitem>
|
---|
259 | <indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
|
---|
260 | <para>starts <command>vim</command> in read-only mode.</para>
|
---|
261 | </listitem>
|
---|
262 | </varlistentry>
|
---|
263 |
|
---|
264 | <varlistentry xml:id="vim">
|
---|
265 | <term><command>vim</command></term>
|
---|
266 | <listitem>
|
---|
267 | <indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
|
---|
268 | <para>is the editor.</para>
|
---|
269 | </listitem>
|
---|
270 | </varlistentry>
|
---|
271 |
|
---|
272 | <varlistentry xml:id="vim132">
|
---|
273 | <term><command>vim132</command></term>
|
---|
274 | <listitem>
|
---|
275 | <indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
|
---|
276 | <para>starts <command>vim</command> with the terminal in 132-column mode.</para>
|
---|
277 | </listitem>
|
---|
278 | </varlistentry>
|
---|
279 |
|
---|
280 | <varlistentry xml:id="vim2html.pl">
|
---|
281 | <term><command>vim2html.pl</command></term>
|
---|
282 | <listitem>
|
---|
283 | <indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
|
---|
284 | <para>converts Vim documentation to HTML.</para>
|
---|
285 | </listitem>
|
---|
286 | </varlistentry>
|
---|
287 |
|
---|
288 | <varlistentry xml:id="vimdiff">
|
---|
289 | <term><command>vimdiff</command></term>
|
---|
290 | <listitem>
|
---|
291 | <indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
|
---|
292 | <para>edits two or three versions of a file with <command>vim</command> and show differences.</para>
|
---|
293 | </listitem>
|
---|
294 | </varlistentry>
|
---|
295 |
|
---|
296 | <varlistentry xml:id="vimm">
|
---|
297 | <term><command>vimm</command></term>
|
---|
298 | <listitem>
|
---|
299 | <indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
|
---|
300 | <para>enables the DEC locator input model on a remote terminal.</para>
|
---|
301 | </listitem>
|
---|
302 | </varlistentry>
|
---|
303 |
|
---|
304 | <varlistentry xml:id="vimspell.sh">
|
---|
305 | <term><command>vimspell.sh</command></term>
|
---|
306 | <listitem>
|
---|
307 | <indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
|
---|
308 | <para>is a script which spells a file and generates the syntax statements necessary
|
---|
309 | to highlight in <command>vim</command>. This script requires the old Unix <command>spell</command>
|
---|
310 | command, which is provided neither in LFS nor in BLFS.</para>
|
---|
311 | </listitem>
|
---|
312 | </varlistentry>
|
---|
313 |
|
---|
314 | <varlistentry xml:id="vimtutor">
|
---|
315 | <term><command>vimtutor</command></term>
|
---|
316 | <listitem>
|
---|
317 | <indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
|
---|
318 | <para>teaches you the basic keys and commands of <command>vim</command>.</para>
|
---|
319 | </listitem>
|
---|
320 | </varlistentry>
|
---|
321 |
|
---|
322 | <varlistentry xml:id="xxd">
|
---|
323 | <term><command>xxd</command></term>
|
---|
324 | <listitem>
|
---|
325 | <indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
|
---|
326 | <para>makes a hex dump of the given file. It can
|
---|
327 | also do the reverse, so it can be used for binary patching.</para>
|
---|
328 | </listitem>
|
---|
329 | </varlistentry>
|
---|
330 | </variablelist>
|
---|
331 |
|
---|
332 | </section>
|
---|
333 |
|
---|
334 | </section>
|
---|