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

systemd
Last change on this file since ce6b8dc was cf292dc, checked in by Chris Staub <chris@…>, 9 years ago

Fixed errors in vim install

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