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 | </sect2> |
---|
23 | |
---|
24 | &env-target; |
---|
25 | |
---|
26 | <sect2 role="installation"> |
---|
27 | <title>Installation of Vim</title> |
---|
28 | |
---|
29 | <tip os="t1"> |
---|
30 | <title>Alternatives to Vim</title> |
---|
31 | |
---|
32 | <para>If you prefer another editor—such as Emacs, Joe, or |
---|
33 | Nano—please refer to <ulink |
---|
34 | url="&cblfs-root;index.php/Category:Text_Editors"/> |
---|
35 | for suggested installation instructions.</para> |
---|
36 | </tip> |
---|
37 | |
---|
38 | <para os="a">First, unpack both <filename>vim-&vim-version;.tar.bz2</filename> |
---|
39 | and (optionally) <filename>vim-&vim-version;-lang.tar.gz</filename> |
---|
40 | archives into the same directory.</para> |
---|
41 | |
---|
42 | <para os="p1">The following patch merges all updates from the &vim-version; Branch |
---|
43 | from the Vim developers:</para> |
---|
44 | |
---|
45 | <screen os="p2"><userinput>patch -Np1 -i ../&vim-branch_update-patch;</userinput></screen> |
---|
46 | |
---|
47 | <para os="cc1">The <command>configure</command> script is full of logic |
---|
48 | that aborts at the first sign of cross compiling. Set the cached values |
---|
49 | of those tests with the following command:</para> |
---|
50 | |
---|
51 | <screen os="cc2"><userinput>cat > src/auto/config.cache << EOF |
---|
52 | vim_cv_getcwd_broken=no |
---|
53 | vim_cv_memmove_handles_overlap=yes |
---|
54 | vim_cv_stat_ignores_slash=no |
---|
55 | vim_cv_terminfo=yes |
---|
56 | vim_cv_tgent=zero |
---|
57 | vim_cv_toupper_broken=no |
---|
58 | vim_cv_tty_group=world |
---|
59 | ac_cv_sizeof_int=4 |
---|
60 | EOF</userinput></screen> |
---|
61 | |
---|
62 | <para os="b">Change the default location of |
---|
63 | the <filename>vimrc</filename> configuration file to <filename |
---|
64 | class="directory">/etc</filename>:</para> |
---|
65 | |
---|
66 | <screen os="c"><userinput>cat >> src/feature.h << "EOF" |
---|
67 | #define SYS_VIMRC_FILE "/etc/vimrc" |
---|
68 | EOF</userinput></screen> |
---|
69 | |
---|
70 | <para os="d">Prepare Vim for compilation:</para> |
---|
71 | |
---|
72 | <screen os="e"><userinput>./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \ |
---|
73 | --prefix=/usr --enable-multibyte --enable-gui=no \ |
---|
74 | --disable-gtktest --disable-xim --with-features=normal \ |
---|
75 | --disable-gpm --without-x --disable-netbeans \ |
---|
76 | --with-tlib=ncurses</userinput></screen> |
---|
77 | |
---|
78 | <variablelist os="f"> |
---|
79 | <title>The meaning of the configure options:</title> |
---|
80 | |
---|
81 | <varlistentry> |
---|
82 | <term><parameter>--enable-multibyte</parameter></term> |
---|
83 | <listitem> |
---|
84 | <para>This optional but highly recommended switch enables support |
---|
85 | for editing files in multibyte character encodings. This is needed |
---|
86 | if using a locale with a multibyte character set. This switch is |
---|
87 | also helpful to be able to edit text files initially created in |
---|
88 | Linux distributions like Fedora that use UTF-8 as a default |
---|
89 | character set.</para> |
---|
90 | </listitem> |
---|
91 | </varlistentry> |
---|
92 | |
---|
93 | </variablelist> |
---|
94 | |
---|
95 | <para os="g">Compile the package:</para> |
---|
96 | |
---|
97 | <screen os="h"><userinput>make</userinput></screen> |
---|
98 | |
---|
99 | <para os="i">Install the package:</para> |
---|
100 | |
---|
101 | <screen os="j"><userinput>make DESTDIR=${CLFS} install</userinput></screen> |
---|
102 | |
---|
103 | <para os="k">Many users are accustomed to using <command>vi</command> |
---|
104 | instead of <command>vim</command>. Some programs, such as |
---|
105 | <command>vigr</command> and <command>vipw</command>, also use |
---|
106 | <command>vi</command>. Create a symlink to permit execution of |
---|
107 | <command>vim</command> when users habitually enter <command>vi</command> |
---|
108 | and allow programs that use <command>vi</command> to work:</para> |
---|
109 | |
---|
110 | <screen os="l"><userinput>ln -sfv vim ${CLFS}/usr/bin/vi</userinput></screen> |
---|
111 | |
---|
112 | <para os="m">By default, Vim's documentation is installed in |
---|
113 | <filename class="directory">/usr/share/vim</filename>. The following symlink |
---|
114 | allows the documentation to be accessed via |
---|
115 | <filename class="directory">/usr/share/doc/vim-&vim-version;</filename>, making |
---|
116 | it consistent with the location of documentation for other packages:</para> |
---|
117 | |
---|
118 | <screen os="n"><userinput>ln -sfnv ../vim/vim&vim-version2;/doc ${CLFS}/usr/share/doc/vim-&vim-version;</userinput></screen> |
---|
119 | |
---|
120 | <para os="o">If an X Window System is going to be installed on the CLFS |
---|
121 | system, you may want to recompile Vim after installing X. Vim |
---|
122 | comes with a GUI version of the editor that requires X and some |
---|
123 | additional libraries to be installed. For more information, refer to the |
---|
124 | Vim documentation and the Vim installation page in CBLFS at <ulink |
---|
125 | url="&cblfs-root;index.php/Vim"/>.</para> |
---|
126 | |
---|
127 | </sect2> |
---|
128 | |
---|
129 | <sect2 id="conf-vim" role="configuration"> |
---|
130 | <title>Configuring Vim</title> |
---|
131 | |
---|
132 | <indexterm zone="conf-vim"> |
---|
133 | <primary sortas="e-/etc/vimrc">/etc/vimrc</primary> |
---|
134 | </indexterm> |
---|
135 | |
---|
136 | <para>By default, <command>vim</command> runs in vi-incompatible mode. |
---|
137 | This may be new to users who have used other editors in the past. The |
---|
138 | <quote>nocompatible</quote> setting is included below to highlight the |
---|
139 | fact that a new behavior is being used. It also reminds those who would |
---|
140 | change to <quote>compatible</quote> mode that it should be the first |
---|
141 | setting in the configuration file. This is necessary because it changes |
---|
142 | other settings, and overrides must come after this setting. Create a |
---|
143 | default <command>vim</command> configuration file by running the |
---|
144 | following:</para> |
---|
145 | |
---|
146 | <screen><userinput>cat > ${CLFS}/etc/vimrc << "EOF" |
---|
147 | <literal>" Begin /etc/vimrc |
---|
148 | |
---|
149 | set nocompatible |
---|
150 | set backspace=2 |
---|
151 | syntax on |
---|
152 | if (&term == "iterm") || (&term == "putty") |
---|
153 | set background=dark |
---|
154 | endif |
---|
155 | |
---|
156 | " End /etc/vimrc</literal> |
---|
157 | EOF</userinput></screen> |
---|
158 | |
---|
159 | |
---|
160 | <para>The <parameter>set nocompatible</parameter> makes |
---|
161 | <command>vim</command> behave in a more useful way (the default) than |
---|
162 | the vi-compatible manner. Remove the <quote>no</quote> to keep the |
---|
163 | old <command>vi</command> behavior. The <parameter>set |
---|
164 | backspace=2</parameter> allows backspacing over line breaks, |
---|
165 | autoindents, and the start of insert. The <parameter>syntax |
---|
166 | on</parameter> enables vim's syntax highlighting. Finally, the |
---|
167 | <emphasis>if</emphasis> statement with the <parameter>set |
---|
168 | background=dark</parameter> corrects <command>vim</command>'s guess |
---|
169 | about the background color of some terminal emulators. This gives the |
---|
170 | highlighting a better color scheme for use on the black background of |
---|
171 | these programs.</para> |
---|
172 | |
---|
173 | <para>Documentation for other available options can be obtained by |
---|
174 | running the following command:</para> |
---|
175 | |
---|
176 | <screen role="nodump"><userinput>vim -c ':options'</userinput></screen> |
---|
177 | |
---|
178 | </sect2> |
---|
179 | |
---|
180 | <sect2 id="contents-vim" role="content"> |
---|
181 | <title>Contents of Vim</title> |
---|
182 | |
---|
183 | <segmentedlist> |
---|
184 | <segtitle>Installed programs</segtitle> |
---|
185 | |
---|
186 | <seglistitem> |
---|
187 | <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk, |
---|
188 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, |
---|
189 | tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl, |
---|
190 | vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg> |
---|
191 | </seglistitem> |
---|
192 | </segmentedlist> |
---|
193 | |
---|
194 | <variablelist> |
---|
195 | <bridgehead renderas="sect3">Short Descriptions</bridgehead> |
---|
196 | <?dbfo list-presentation="list"?> |
---|
197 | <?dbhtml list-presentation="table"?> |
---|
198 | |
---|
199 | <varlistentry id="efm_filter.pl"> |
---|
200 | <term><command>efm_filter.pl</command></term> |
---|
201 | <listitem> |
---|
202 | <para>A filter for creating an error file that can be read |
---|
203 | by <command>vim</command></para> |
---|
204 | <indexterm zone="ch-system-vim efm_filter.pl"> |
---|
205 | <primary sortas="b-efm_filter.pl">efm_filter.pl</primary> |
---|
206 | </indexterm> |
---|
207 | </listitem> |
---|
208 | </varlistentry> |
---|
209 | |
---|
210 | <varlistentry id="efm_perl.pl"> |
---|
211 | <term><command>efm_perl.pl</command></term> |
---|
212 | <listitem> |
---|
213 | <para>Reformats the error messages of the Perl interpreter for use |
---|
214 | with the <quote>quickfix</quote> mode of <command>vim</command></para> |
---|
215 | <indexterm zone="ch-system-vim efm_perl.pl"> |
---|
216 | <primary sortas="b-efm_perl.pl">efm_perl.pl</primary> |
---|
217 | </indexterm> |
---|
218 | </listitem> |
---|
219 | </varlistentry> |
---|
220 | |
---|
221 | <varlistentry id="ex"> |
---|
222 | <term><command>ex</command></term> |
---|
223 | <listitem> |
---|
224 | <para>Starts <command>vim</command> in ex mode</para> |
---|
225 | <indexterm zone="ch-system-vim ex"> |
---|
226 | <primary sortas="b-ex">ex</primary> |
---|
227 | </indexterm> |
---|
228 | </listitem> |
---|
229 | </varlistentry> |
---|
230 | |
---|
231 | <varlistentry id="less.sh"> |
---|
232 | <term><command>less.sh</command></term> |
---|
233 | <listitem> |
---|
234 | <para>A script that starts <command>vim</command> with less.vim</para> |
---|
235 | <indexterm zone="ch-system-vim less.sh"> |
---|
236 | <primary sortas="b-less.sh">less.sh</primary> |
---|
237 | </indexterm> |
---|
238 | </listitem> |
---|
239 | </varlistentry> |
---|
240 | |
---|
241 | <varlistentry id="mve.awk"> |
---|
242 | <term><command>mve.awk</command></term> |
---|
243 | <listitem> |
---|
244 | <para>Processes <command>vim</command> errors</para> |
---|
245 | <indexterm zone="ch-system-vim mve.awk"> |
---|
246 | <primary sortas="b-mve.awk">mve.awk</primary> |
---|
247 | </indexterm> |
---|
248 | </listitem> |
---|
249 | </varlistentry> |
---|
250 | |
---|
251 | <varlistentry id="pltags.pl"> |
---|
252 | <term><command>pltags.pl</command></term> |
---|
253 | <listitem> |
---|
254 | <para>Creates a tags file for Perl code for use by |
---|
255 | <command>vim</command></para> |
---|
256 | <indexterm zone="ch-system-vim pltags.pl"> |
---|
257 | <primary sortas="b-pltags.pl">pltags.pl</primary> |
---|
258 | </indexterm> |
---|
259 | </listitem> |
---|
260 | </varlistentry> |
---|
261 | |
---|
262 | <varlistentry id="ref"> |
---|
263 | <term><command>ref</command></term> |
---|
264 | <listitem> |
---|
265 | <para>Checks the spelling of arguments</para> |
---|
266 | <indexterm zone="ch-system-vim ref"> |
---|
267 | <primary sortas="b-ref">ref</primary> |
---|
268 | </indexterm> |
---|
269 | </listitem> |
---|
270 | </varlistentry> |
---|
271 | |
---|
272 | <varlistentry id="rview"> |
---|
273 | <term><command>rview</command></term> |
---|
274 | <listitem> |
---|
275 | <para>Is a restricted version of <command>view</command>; no shell |
---|
276 | commands can be started and <command>view</command> cannot be |
---|
277 | suspended</para> |
---|
278 | <indexterm zone="ch-system-vim rview"> |
---|
279 | <primary sortas="b-rview">rview</primary> |
---|
280 | </indexterm> |
---|
281 | </listitem> |
---|
282 | </varlistentry> |
---|
283 | |
---|
284 | <varlistentry id="rvim"> |
---|
285 | <term><command>rvim</command></term> |
---|
286 | <listitem> |
---|
287 | <para>Is a restricted version of <command>vim</command>; no shell |
---|
288 | commands can be started and <command>vim</command> cannot be |
---|
289 | suspended</para> |
---|
290 | <indexterm zone="ch-system-vim rvim"> |
---|
291 | <primary sortas="b-rvim">rvim</primary> |
---|
292 | </indexterm> |
---|
293 | </listitem> |
---|
294 | </varlistentry> |
---|
295 | |
---|
296 | <varlistentry id="shtags.pl"> |
---|
297 | <term><command>shtags.pl</command></term> |
---|
298 | <listitem> |
---|
299 | <para>Generates a tags file for Perl scripts</para> |
---|
300 | <indexterm zone="ch-system-vim shtags.pl"> |
---|
301 | <primary sortas="b-shtags.pl">shtags.pl</primary> |
---|
302 | </indexterm> |
---|
303 | </listitem> |
---|
304 | </varlistentry> |
---|
305 | |
---|
306 | <varlistentry id="tcltags"> |
---|
307 | <term><command>tcltags</command></term> |
---|
308 | <listitem> |
---|
309 | <para>Generates a tags file for TCL code</para> |
---|
310 | <indexterm zone="ch-system-vim tcltags"> |
---|
311 | <primary sortas="b-tcltags">tcltags</primary> |
---|
312 | </indexterm> |
---|
313 | </listitem> |
---|
314 | </varlistentry> |
---|
315 | |
---|
316 | <varlistentry id="view"> |
---|
317 | <term><command>view</command></term> |
---|
318 | <listitem> |
---|
319 | <para>Starts <command>vim</command> in read-only mode</para> |
---|
320 | <indexterm zone="ch-system-vim view"> |
---|
321 | <primary sortas="b-view">view</primary> |
---|
322 | </indexterm> |
---|
323 | </listitem> |
---|
324 | </varlistentry> |
---|
325 | |
---|
326 | <varlistentry id="vi"> |
---|
327 | <term><command>vi</command></term> |
---|
328 | <listitem> |
---|
329 | <para>Link to <command>vim</command></para> |
---|
330 | <indexterm zone="ch-system-vim vi"> |
---|
331 | <primary sortas="b-vi">vi</primary> |
---|
332 | </indexterm> |
---|
333 | </listitem> |
---|
334 | </varlistentry> |
---|
335 | |
---|
336 | <varlistentry id="vim"> |
---|
337 | <term><command>vim</command></term> |
---|
338 | <listitem> |
---|
339 | <para>Is the editor</para> |
---|
340 | <indexterm zone="ch-system-vim vim"> |
---|
341 | <primary sortas="b-vim">vim</primary> |
---|
342 | </indexterm> |
---|
343 | </listitem> |
---|
344 | </varlistentry> |
---|
345 | |
---|
346 | <varlistentry id="vim132"> |
---|
347 | <term><command>vim132</command></term> |
---|
348 | <listitem> |
---|
349 | <para>Starts <command>vim</command> with the terminal in 132-column |
---|
350 | mode</para> |
---|
351 | <indexterm zone="ch-system-vim vim132"> |
---|
352 | <primary sortas="b-vim132">vim132</primary> |
---|
353 | </indexterm> |
---|
354 | </listitem> |
---|
355 | </varlistentry> |
---|
356 | |
---|
357 | <varlistentry id="vim2html.pl"> |
---|
358 | <term><command>vim2html.pl</command></term> |
---|
359 | <listitem> |
---|
360 | <para>Converts Vim documentation to HypterText Markup Language |
---|
361 | (HTML)</para> |
---|
362 | <indexterm zone="ch-system-vim vim2html.pl"> |
---|
363 | <primary sortas="b-vim2html.pl">vim2html.pl</primary> |
---|
364 | </indexterm> |
---|
365 | </listitem> |
---|
366 | </varlistentry> |
---|
367 | |
---|
368 | <varlistentry id="vimdiff"> |
---|
369 | <term><command>vimdiff</command></term> |
---|
370 | <listitem> |
---|
371 | <para>Edits two or three versions of a file with <command>vim</command> |
---|
372 | and show differences</para> |
---|
373 | <indexterm zone="ch-system-vim vimdiff"> |
---|
374 | <primary sortas="b-vimdiff">vimdiff</primary> |
---|
375 | </indexterm> |
---|
376 | </listitem> |
---|
377 | </varlistentry> |
---|
378 | |
---|
379 | <varlistentry id="vimm"> |
---|
380 | <term><command>vimm</command></term> |
---|
381 | <listitem> |
---|
382 | <para>Enables the DEC locator input model on a remote terminal</para> |
---|
383 | <indexterm zone="ch-system-vim vimm"> |
---|
384 | <primary sortas="b-vimm">vimm</primary> |
---|
385 | </indexterm> |
---|
386 | </listitem> |
---|
387 | </varlistentry> |
---|
388 | |
---|
389 | <varlistentry id="vimspell.sh"> |
---|
390 | <term><command>vimspell.sh</command></term> |
---|
391 | <listitem> |
---|
392 | <para>Spell checks a file and generates the syntax statements |
---|
393 | necessary to highlight in <command>vim</command>. This script |
---|
394 | requires the old Unix <command>spell</command> command, which |
---|
395 | is provided neither in CLFS nor in BLFS</para> |
---|
396 | <indexterm zone="ch-system-vim vimspell.sh"> |
---|
397 | <primary sortas="b-vimspell.sh">vimspell.sh</primary> |
---|
398 | </indexterm> |
---|
399 | </listitem> |
---|
400 | </varlistentry> |
---|
401 | |
---|
402 | <varlistentry id="vimtutor"> |
---|
403 | <term><command>vimtutor</command></term> |
---|
404 | <listitem> |
---|
405 | <para>Teaches the basic keys and commands of |
---|
406 | <command>vim</command></para> |
---|
407 | <indexterm zone="ch-system-vim vimtutor"> |
---|
408 | <primary sortas="b-vimtutor">vimtutor</primary> |
---|
409 | </indexterm> |
---|
410 | </listitem> |
---|
411 | </varlistentry> |
---|
412 | |
---|
413 | <varlistentry id="xxd"> |
---|
414 | <term><command>xxd</command></term> |
---|
415 | <listitem> |
---|
416 | <para>Creates a hex dump of the given file; it can |
---|
417 | also do the reverse, so it can be used for binary patching</para> |
---|
418 | <indexterm zone="ch-system-vim xxd"> |
---|
419 | <primary sortas="b-xxd">xxd</primary> |
---|
420 | </indexterm> |
---|
421 | </listitem> |
---|
422 | </varlistentry> |
---|
423 | |
---|
424 | </variablelist> |
---|
425 | |
---|
426 | </sect2> |
---|
427 | |
---|
428 | </sect1> |
---|