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 |
|
---|
27 | <tip>
|
---|
28 | <title>Alternatives to Vim</title>
|
---|
29 | <para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,
|
---|
30 | have a look at <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> for
|
---|
31 | suggested installation instructions.</para>
|
---|
32 | </tip>
|
---|
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" role="configuration"><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 | set background=dark
|
---|
102 |
|
---|
103 | " End /etc/vimrc
|
---|
104 | <userinput>EOF</userinput></screen>
|
---|
105 |
|
---|
106 | <para>The <emphasis>set nocompatible</emphasis> makes
|
---|
107 | <command>vim</command> behave in a more useful way (the default) than the
|
---|
108 | vi-compatible manner. Remove the "no" if you want the old <command>vi</command>
|
---|
109 | behavior. The <emphasis>set backspace=2</emphasis> allows
|
---|
110 | backspacing over line breaks, autoindents and the start of insert. The
|
---|
111 | <emphasis>syntax on</emphasis> enables <command>vim</command>'s
|
---|
112 | syntax highliting, while <emphasis>set background=dark</emphasis> gives the
|
---|
113 | highliting a better color scheme for use on the black background of a linux
|
---|
114 | console. If you later use X and terminals with a light background, changing
|
---|
115 | this will be useful.</para>
|
---|
116 |
|
---|
117 | <para>Documentation for other available options can be obtained by running
|
---|
118 | the following command:</para>
|
---|
119 |
|
---|
120 | <screen><userinput>vim -c ':options'</userinput></screen>
|
---|
121 |
|
---|
122 | </sect2>
|
---|
123 |
|
---|
124 |
|
---|
125 | <sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
|
---|
126 |
|
---|
127 | <segmentedlist>
|
---|
128 | <segtitle>Installed programs</segtitle>
|
---|
129 | <seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
|
---|
130 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
|
---|
131 | view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
|
---|
132 | vimtutor and xxd</seg></seglistitem>
|
---|
133 | </segmentedlist>
|
---|
134 |
|
---|
135 | <variablelist><title>Short descriptions</title>
|
---|
136 |
|
---|
137 | <varlistentry id="efm_filter.pl">
|
---|
138 | <term><command>efm_filter.pl</command></term>
|
---|
139 | <listitem>
|
---|
140 | <indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
|
---|
141 | <para>is a filter for creating an error file that can be read by vim.</para>
|
---|
142 | </listitem>
|
---|
143 | </varlistentry>
|
---|
144 |
|
---|
145 | <varlistentry id="efm_perl.pl">
|
---|
146 | <term><command>efm_perl.pl</command></term>
|
---|
147 | <listitem>
|
---|
148 | <indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
|
---|
149 | <para>reformats the error messages of the
|
---|
150 | Perl interpreter for use with the <quote>quickfix</quote> mode of vim.</para>
|
---|
151 | </listitem>
|
---|
152 | </varlistentry>
|
---|
153 |
|
---|
154 | <varlistentry id="ex">
|
---|
155 | <term><command>ex</command></term>
|
---|
156 | <listitem>
|
---|
157 | <indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
|
---|
158 | <para>starts vim in ex mode.</para>
|
---|
159 | </listitem>
|
---|
160 | </varlistentry>
|
---|
161 |
|
---|
162 | <varlistentry id="less.sh">
|
---|
163 | <term><command>less.sh</command></term>
|
---|
164 | <listitem>
|
---|
165 | <indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
|
---|
166 | <para>is a script that starts vim with less.vim.</para>
|
---|
167 | </listitem>
|
---|
168 | </varlistentry>
|
---|
169 |
|
---|
170 | <varlistentry id="mve.awk">
|
---|
171 | <term><command>mve.awk</command></term>
|
---|
172 | <listitem>
|
---|
173 | <indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
|
---|
174 | <para>processes vim errors.</para>
|
---|
175 | </listitem>
|
---|
176 | </varlistentry>
|
---|
177 |
|
---|
178 | <varlistentry id="pltags.pl">
|
---|
179 | <term><command>pltags.pl</command></term>
|
---|
180 | <listitem>
|
---|
181 | <indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
|
---|
182 | <para>creates a tags file for perl code, for use by vim.</para>
|
---|
183 | </listitem>
|
---|
184 | </varlistentry>
|
---|
185 |
|
---|
186 | <varlistentry id="ref">
|
---|
187 | <term><command>ref</command></term>
|
---|
188 | <listitem>
|
---|
189 | <indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
|
---|
190 | <para>checks the spelling of arguments.</para>
|
---|
191 | </listitem>
|
---|
192 | </varlistentry>
|
---|
193 |
|
---|
194 | <varlistentry id="rview">
|
---|
195 | <term><command>rview</command></term>
|
---|
196 | <listitem>
|
---|
197 | <indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
|
---|
198 | <para>is a restricted version of view: no shell
|
---|
199 | commands can be started and view can't be suspended.</para>
|
---|
200 | </listitem>
|
---|
201 | </varlistentry>
|
---|
202 |
|
---|
203 | <varlistentry id="rvim">
|
---|
204 | <term><command>rvim</command></term>
|
---|
205 | <listitem>
|
---|
206 | <indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
|
---|
207 | <para>is a restricted version of vim: no shell
|
---|
208 | commands can be started and vim can't be suspended.</para>
|
---|
209 | </listitem>
|
---|
210 | </varlistentry>
|
---|
211 |
|
---|
212 | <varlistentry id="shtags.pl">
|
---|
213 | <term><command>shtags.pl</command></term>
|
---|
214 | <listitem>
|
---|
215 | <indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
|
---|
216 | <para>generates a tag file for perl scripts.</para>
|
---|
217 | </listitem>
|
---|
218 | </varlistentry>
|
---|
219 |
|
---|
220 | <varlistentry id="tcltags">
|
---|
221 | <term><command>tcltags</command></term>
|
---|
222 | <listitem>
|
---|
223 | <indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
|
---|
224 | <para>generates a tag file for TCL code.</para>
|
---|
225 | </listitem>
|
---|
226 | </varlistentry>
|
---|
227 |
|
---|
228 | <varlistentry id="view">
|
---|
229 | <term><command>view</command></term>
|
---|
230 | <listitem>
|
---|
231 | <indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
|
---|
232 | <para>starts vim in read-only mode.</para>
|
---|
233 | </listitem>
|
---|
234 | </varlistentry>
|
---|
235 |
|
---|
236 | <varlistentry id="vim">
|
---|
237 | <term><command>vim</command></term>
|
---|
238 | <listitem>
|
---|
239 | <indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
|
---|
240 | <para>is the editor.</para>
|
---|
241 | </listitem>
|
---|
242 | </varlistentry>
|
---|
243 |
|
---|
244 | <varlistentry id="vim132">
|
---|
245 | <term><command>vim132</command></term>
|
---|
246 | <listitem>
|
---|
247 | <indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
|
---|
248 | <para>starts vim with the terminal in 132-column mode.</para>
|
---|
249 | </listitem>
|
---|
250 | </varlistentry>
|
---|
251 |
|
---|
252 | <varlistentry id="vim2html.pl">
|
---|
253 | <term><command>vim2html.pl</command></term>
|
---|
254 | <listitem>
|
---|
255 | <indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
|
---|
256 | <para>converts vim documentation to HTML.</para>
|
---|
257 | </listitem>
|
---|
258 | </varlistentry>
|
---|
259 |
|
---|
260 | <varlistentry id="vimdiff">
|
---|
261 | <term><command>vimdiff</command></term>
|
---|
262 | <listitem>
|
---|
263 | <indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
|
---|
264 | <para>edits two or three versions of a file with vim and show differences.</para>
|
---|
265 | </listitem>
|
---|
266 | </varlistentry>
|
---|
267 |
|
---|
268 | <varlistentry id="vimm">
|
---|
269 | <term><command>vimm</command></term>
|
---|
270 | <listitem>
|
---|
271 | <indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
|
---|
272 | <para>enables the DEC locator input model on a remote terminal.</para>
|
---|
273 | </listitem>
|
---|
274 | </varlistentry>
|
---|
275 |
|
---|
276 | <varlistentry id="vimspell.sh">
|
---|
277 | <term><command>vimspell.sh</command></term>
|
---|
278 | <listitem>
|
---|
279 | <indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
|
---|
280 | <para>is a script which spells a file and generates the syntax statements necessary
|
---|
281 | to highlight in vim. This script requires the old Unix <command>spell</command>
|
---|
282 | command, which is provided neither in LFS nor in BLFS.</para>
|
---|
283 | </listitem>
|
---|
284 | </varlistentry>
|
---|
285 |
|
---|
286 | <varlistentry id="vimtutor">
|
---|
287 | <term><command>vimtutor</command></term>
|
---|
288 | <listitem>
|
---|
289 | <indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
|
---|
290 | <para>teaches you the basic keys and commands of vim.</para>
|
---|
291 | </listitem>
|
---|
292 | </varlistentry>
|
---|
293 |
|
---|
294 | <varlistentry id="xxd">
|
---|
295 | <term><command>xxd</command></term>
|
---|
296 | <listitem>
|
---|
297 | <indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
|
---|
298 | <para>makes a hex dump of the given file. It can
|
---|
299 | also do the reverse, so it can be used for binary patching.</para>
|
---|
300 | </listitem>
|
---|
301 | </varlistentry>
|
---|
302 | </variablelist>
|
---|
303 |
|
---|
304 | </sect2>
|
---|
305 |
|
---|
306 | </sect1>
|
---|