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

clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 9f83afef was 7e8d40c, checked in by William Harrington <kb0iic@…>, 11 years ago

Comment out vim branch update patch as there are none at this time.

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