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

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since e583269 was 44fb8dd, checked in by Jim Gifford <clfs@…>, 16 years ago

Fixed Look of Vim page

  • Property mode set to 100644
File size: 14.6 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="a">First, unpack both <filename>vim-&vim-version;.tar.bz2</filename>
37 and (optionally) <filename>vim-&vim-version;-lang.tar.gz</filename>
38 archives into the same directory.</para>
39
40 <para os="p1">The following patch merges all updates from the &vim-version; Branch
41 from the Vim developers:</para>
42
43<screen os="p2"><userinput>patch -Np1 -i ../&vim-branch_update-patch;</userinput></screen>
44
45 <para os="b">Change the default location of
46 the <filename>vimrc</filename> configuration file to <filename
47 class="directory">/etc</filename>:</para>
48
49<screen os="c"><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
50
51 <para os="d">Prepare Vim for compilation:</para>
52
53<screen os="e"><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
54
55 <variablelist os="f">
56 <title>The meaning of the configure options:</title>
57
58 <varlistentry>
59 <term><parameter>--enable-multibyte</parameter></term>
60 <listitem>
61 <para>This optional but highly recommended switch enables support
62 for editing files in multibyte character encodings. This is needed
63 if using a locale with a multibyte character set. This switch is
64 also helpful to be able to edit text files initially created in
65 Linux distributions like Fedora Core that use UTF-8 as a default
66 character set.</para>
67 </listitem>
68 </varlistentry>
69
70 </variablelist>
71
72 <para os="g">Compile the package:</para>
73
74<screen os="h"><userinput>make</userinput></screen>
75
76 <para os="i">To test the results, issue: <userinput>make test</userinput>.
77 However, this test suite outputs a lot of binary data to the
78 screen, which can cause issues with the settings of the current terminal.
79 This can be resolved by redirecting the output to a log file.</para>
80
81 <para os="j">Install the package:</para>
82
83<screen os="k"><userinput>make install</userinput></screen>
84
85 <para os="l">Many users are accustomed to using <command>vi</command>
86 instead of <command>vim</command>. Some programs, such as
87 <command>vigr</command> and <command>vipw</command>, also use
88 <command>vi</command>. Create a symlink to permit execution of
89 <command>vim</command> when users habitually enter <command>vi</command>
90 and allow programs that use <command>vi</command> to work:</para>
91
92<screen os="m"><userinput>ln -sv vim /usr/bin/vi</userinput></screen>
93
94<para os="n">By default, Vim's documentation is installed in
95<filename class="directory">/usr/share/vim</filename>. The following symlink
96allows the documentation to be accessed via
97<filename class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
98it consistent with the location of documentation for other packages:</para>
99
100<screen os="o"><userinput>ln -sv ../vim/vim&vim-version2;/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
101
102 <para os="p">If an X Window System is going to be installed on the CLFS
103 system, you may want to recompile Vim after installing X. Vim
104 comes with a GUI version of the editor that requires X and some
105 additional libraries to be installed. For more information, refer to the
106 Vim documentation and the Vim installation page in CBLFS at <ulink
107 url="&cblfs-root;index.php/Vim"/>.</para>
108
109 </sect2>
110
111 <sect2 id="conf-vim" role="configuration">
112 <title>Configuring Vim</title>
113
114 <indexterm zone="conf-vim">
115 <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
116 </indexterm>
117
118 <para>By default, <command>vim</command> runs in vi-incompatible mode.
119 This may be new to users who have used other editors in the past. The
120 <quote>nocompatible</quote> setting is included below to highlight the
121 fact that a new behavior is being used. It also reminds those who would
122 change to <quote>compatible</quote> mode that it should be the first
123 setting in the configuration file. This is necessary because it changes
124 other settings, and overrides must come after this setting. Create a
125 default <command>vim</command> configuration file by running the
126 following:</para>
127
128<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
129<literal>" Begin /etc/vimrc
130
131set nocompatible
132set backspace=2
133syntax on
134if (&amp;term == "iterm") || (&amp;term == "putty")
135 set background=dark
136endif
137
138" End /etc/vimrc</literal>
139EOF</userinput></screen>
140
141
142 <para>The <parameter>set nocompatible</parameter> makes
143 <command>vim</command> behave in a more useful way (the default) than
144 the vi-compatible manner. Remove the <quote>no</quote> to keep the
145 old <command>vi</command> behavior. The <parameter>set
146 backspace=2</parameter> allows backspacing over line breaks,
147 autoindents, and the start of insert. The <parameter>syntax
148 on</parameter> enables vim's syntax highlighting. Finally, the
149 <emphasis>if</emphasis> statement with the <parameter>set
150 background=dark</parameter> corrects <command>vim</command>'s guess
151 about the background color of some terminal emulators. This gives the
152 highlighting a better color scheme for use on the black background of
153 these programs.</para>
154
155 <para>Documentation for other available options can be obtained by
156 running the following command:</para>
157
158<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
159
160 </sect2>
161
162 <sect2 id="contents-vim" role="content">
163 <title>Contents of Vim</title>
164
165 <segmentedlist>
166 <segtitle>Installed programs</segtitle>
167
168 <seglistitem>
169 <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
170 pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
171 tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
172 vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</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.