source: chapter06/vim.xml@ 1dc34de7

6.0
Last change on this file since 1dc34de7 was ef13657, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Completed global edits for upcoming 6.0 release

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4000 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 11.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-vim" xreflabel="Vim" role="wrap">
7<title>Vim-&vim-version;</title>
8<?dbhtml filename="vim.html"?>
9
10<indexterm zone="ch-system-vim"><primary sortas="a-Vim">Vim</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Vim package contains a powerful text editor.</para>
14
15<segmentedlist>
16<segtitle>&buildtime;</segtitle>
17<segtitle>&diskspace;</segtitle>
18<seglistitem><seg>0.4 SBU</seg><seg>34 MB</seg></seglistitem>
19</segmentedlist>
20
21<segmentedlist>
22<segtitle>Vim installation depends on</segtitle>
23<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
24GCC, Glibc, Grep, Make, Ncurses, Sed</seg></seglistitem>
25</segmentedlist>
26
27<tip>
28<title>Alternatives to Vim</title>
29<para>If you prefer another editor -- like Emacs, Joe, or Nano --
30please refer to <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> for
31suggested installation instructions.</para>
32</tip>
33</sect2>
34
35<sect2 role="installation">
36<title>Installation of Vim</title>
37
38<para>First, unpack both
39<filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
40<filename>vim-&vim-version;-lang.tar.gz</filename> archives into the
41same directory. Then change the default locations of the
42<filename>vimrc</filename> and <filename>gvimrc</filename>
43configuration files to <filename
44class="directory">/etc</filename>:</para>
45
46<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h
47echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h</userinput></screen>
48
49<para>Prepare Vim for compilation:</para>
50
51<screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
52
53<para>The optional but highly recommended
54<parameter>--enable-multibyte</parameter> switch includes support for
55editing files in multibyte character encodings into
56<command>vim</command>. This is needed if the recommendation was not
57heeded to not to use LFS in locales with multibyte character sets.
58This switch is also helpful to be able to edit text files initially
59created in Linux distributions like Fedora Core that use UTF-8 as a
60default character set.</para>
61
62<para>Compile the package:</para>
63
64<screen><userinput>make</userinput></screen>
65
66<para>To test the results, you can issue:
67<userinput>make test</userinput>. However, this test suite outputs a
68lot of chaotic characters to the screen, which can cause issues with
69the settings of the current terminal. Therefore, running the test
70suite here is strictly optional.</para>
71
72<para>Install the package:</para>
73
74<screen><userinput>make install</userinput></screen>
75
76<para>Many users are used to using <command>vi</command>, instead of
77<command>vim</command>. To allow execution of <command>vim</command>
78when they habitually enter <command>vi</command>, create a
79symlink:</para>
80
81<screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
82
83<para>If the X Window system is going to be installed on the LFS
84system, it may be necessary to re-compile Vim after installing X. Vim
85comes with a GUI version of the editor that requires X and some
86additional libraries to be installed. For more information on this
87process, refer to the Vim documentation.</para>
88
89</sect2>
90
91<sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
92<indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
93
94<para>By default, <command>vim</command> runs in vi-incompatible mode.
95This may be new to users who have used other editors in the past. The
96<quote>nocompatible</quote> setting is included below to highlight the
97fact that a new behavior is being used. It also reminds those who
98would change to <quote>compatible</quote> mode that it should appear
99first. This is necessary because it changes other settings, and
100overrides must come after this setting. Create a default vim
101configuration file by running the following:</para>
102
103<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
104" Begin /etc/vimrc
105
106set nocompatible
107set backspace=2
108syntax on
109if (&amp;term == "iterm") || (&amp;term == "putty")
110 set background=dark
111endif
112
113" End /etc/vimrc
114EOF</userinput></screen>
115
116<para>The <parameter>set nocompatible</parameter> makes
117<command>vim</command> behave in a more useful way (the default) than
118the vi-compatible manner. Remove the <quote>no</quote> if you want the
119old <command>vi</command> behavior. The <parameter>set
120backspace=2</parameter> allows backspacing over line breaks,
121autoindents, and the start of insert. The <parameter>syntax
122on</parameter> enables vim's syntax highlighting. Finally, the
123<parameter>if</parameter> statement with the <parameter>set
124background=dark</parameter> corrects <command>vim</command>'s guess
125about the background color of some terminal emulators. This gives the
126highlighting a better color scheme for use on the black background of
127these programs.</para>
128
129<para>Documentation for other available options can be obtained by
130running the following command:</para>
131
132<screen><userinput>vim -c ':options'</userinput></screen>
133
134</sect2>
135
136<sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
137
138<segmentedlist>
139<segtitle>Installed programs</segtitle>
140<seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
141pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
142view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
143vimtutor and xxd</seg></seglistitem>
144</segmentedlist>
145
146<variablelist><title>Short descriptions</title>
147
148<varlistentry id="efm_filter.pl">
149<term><command>efm_filter.pl</command></term>
150<listitem>
151<indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
152<para>a filter for creating an error file that can be read by <command>vim</command>.</para>
153</listitem>
154</varlistentry>
155
156<varlistentry id="efm_perl.pl">
157<term><command>efm_perl.pl</command></term>
158<listitem>
159<indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
160<para>reformats the error messages of the
161Perl interpreter for use with the <quote>quickfix</quote> mode of <command>vim</command>.</para>
162</listitem>
163</varlistentry>
164
165<varlistentry id="ex">
166<term><command>ex</command></term>
167<listitem>
168<indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
169<para>starts <command>vim</command> in ex mode.</para>
170</listitem>
171</varlistentry>
172
173<varlistentry id="less.sh">
174<term><command>less.sh</command></term>
175<listitem>
176<indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
177<para>a script that starts <command>vim</command> with less.vim.</para>
178</listitem>
179</varlistentry>
180
181<varlistentry id="mve.awk">
182<term><command>mve.awk</command></term>
183<listitem>
184<indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
185<para>processes <command>vim</command> errors.</para>
186</listitem>
187</varlistentry>
188
189<varlistentry id="pltags.pl">
190<term><command>pltags.pl</command></term>
191<listitem>
192<indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
193<para>creates a tags file for Perl code, for use by <command>vim</command>.</para>
194</listitem>
195</varlistentry>
196
197<varlistentry id="ref">
198<term><command>ref</command></term>
199<listitem>
200<indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
201<para>checks the spelling of arguments.</para>
202</listitem>
203</varlistentry>
204
205<varlistentry id="rview">
206<term><command>rview</command></term>
207<listitem>
208<indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
209<para>is a restricted version of <command>view</command>: no shell
210commands can be started and <command>view</command> cannot be suspended.</para>
211</listitem>
212</varlistentry>
213
214<varlistentry id="rvim">
215<term><command>rvim</command></term>
216<listitem>
217<indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
218<para>is a restricted version of <command>vim</command>: no shell
219commands can be started and <command>vim</command> cannot be suspended.</para>
220</listitem>
221</varlistentry>
222
223<varlistentry id="shtags.pl">
224<term><command>shtags.pl</command></term>
225<listitem>
226<indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
227<para>generates a tag file for Perl scripts.</para>
228</listitem>
229</varlistentry>
230
231<varlistentry id="tcltags">
232<term><command>tcltags</command></term>
233<listitem>
234<indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
235<para>generates a tag file for TCL code.</para>
236</listitem>
237</varlistentry>
238
239<varlistentry id="view">
240<term><command>view</command></term>
241<listitem>
242<indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
243<para>starts <command>vim</command> in read-only mode.</para>
244</listitem>
245</varlistentry>
246
247<varlistentry id="vim">
248<term><command>vim</command></term>
249<listitem>
250<indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
251<para>is the editor.</para>
252</listitem>
253</varlistentry>
254
255<varlistentry id="vim132">
256<term><command>vim132</command></term>
257<listitem>
258<indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
259<para>starts <command>vim</command> with the terminal in 132-column mode.</para>
260</listitem>
261</varlistentry>
262
263<varlistentry id="vim2html.pl">
264<term><command>vim2html.pl</command></term>
265<listitem>
266<indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
267<para>converts Vim documentation to HTML.</para>
268</listitem>
269</varlistentry>
270
271<varlistentry id="vimdiff">
272<term><command>vimdiff</command></term>
273<listitem>
274<indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
275<para>edits two or three versions of a file with <command>vim</command> and show differences.</para>
276</listitem>
277</varlistentry>
278
279<varlistentry id="vimm">
280<term><command>vimm</command></term>
281<listitem>
282<indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
283<para>enables the DEC locator input model on a remote terminal.</para>
284</listitem>
285</varlistentry>
286
287<varlistentry id="vimspell.sh">
288<term><command>vimspell.sh</command></term>
289<listitem>
290<indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
291<para>a script which spells a file and generates the syntax statements necessary
292to highlight in <command>vim</command>. This script requires the old Unix <command>spell</command>
293command, which is provided neither in LFS nor in BLFS.</para>
294</listitem>
295</varlistentry>
296
297<varlistentry id="vimtutor">
298<term><command>vimtutor</command></term>
299<listitem>
300<indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
301<para>teaches you the basic keys and commands of <command>vim</command>.</para>
302</listitem>
303</varlistentry>
304
305<varlistentry id="xxd">
306<term><command>xxd</command></term>
307<listitem>
308<indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
309<para>creates a hex dump of the given file. It can
310also do the reverse, so it can be used for binary patching.</para>
311</listitem>
312</varlistentry>
313</variablelist>
314
315</sect2>
316
317</sect1>
318
Note: See TracBrowser for help on using the repository browser.