source: BOOK/final-system/common/vim.xml@ ff1e2f9

clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since ff1e2f9 was 6c5a343, checked in by Joe Ciccone <jciccone@…>, 14 years ago

Update Vim to 7.3.

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