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