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

sysvinit
Last change on this file since 60dfcefb was 2004b26, checked in by Chris Staub <chris@…>, 10 years ago

Remove obsolete --enable-multibyte switch from Vim instructions

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