source: chapter06/vim.xml@ 67129a2b

6.0
Last change on this file since 67129a2b was 24a08b9, checked in by Gerard Beekmans <gerard@…>, 20 years ago

General edits. Added bash+readline display_wrap patches

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

  • Property mode set to 100644
File size: 11.5 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 you are using a locale with
57a multibyte character set. This switch is also helpful to be able to
58edit text files initially created in Linux distributions like Fedora
59Core that use UTF-8 as a default character set.</para>
60
61<para>Compile the package:</para>
62
63<screen><userinput>make</userinput></screen>
64
65<para>To test the results, you can issue:
66<userinput>make test</userinput>. However, this test suite outputs a
67lot of chaotic characters to the screen, which can cause issues with
68the settings of the current terminal. Therefore, running the test
69suite here is strictly optional.</para>
70
71<para>Install the package:</para>
72
73<screen><userinput>make install</userinput></screen>
74
75<para>Many users are used to using <command>vi</command>, instead of
76<command>vim</command>. To allow execution of <command>vim</command>
77when they habitually enter <command>vi</command>, create a
78symlink:</para>
79
80<screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
81
82<para>If the X Window system is going to be installed on the LFS
83system, it may be necessary to re-compile Vim after installing X. Vim
84comes with a GUI version of the editor that requires X and some
85additional libraries to be installed. For more information on this
86process, refer to the Vim documentation and the Vim installation page
87in the BLFS book at <ulink
88url="http://www.linuxfromscratch.org/blfs/view/cvs/postlfs/editors.html#postlfs-editors-vim"/>
89.</para>
90
91</sect2>
92
93<sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
94<indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
95
96<para>By default, <command>vim</command> runs in vi-incompatible mode.
97This may be new to users who have used other editors in the past. The
98<quote>nocompatible</quote> setting is included below to highlight the
99fact that a new behavior is being used. It also reminds those who
100would change to <quote>compatible</quote> mode that it should appear
101first. This is necessary because it changes other settings, and
102overrides must come after this setting. Create a default vim
103configuration file by running the following:</para>
104
105<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
106" Begin /etc/vimrc
107
108set nocompatible
109set backspace=2
110syntax on
111if (&amp;term == "iterm") || (&amp;term == "putty")
112 set background=dark
113endif
114
115" End /etc/vimrc
116EOF</userinput></screen>
117
118<para>The <parameter>set nocompatible</parameter> makes
119<command>vim</command> behave in a more useful way (the default) than
120the vi-compatible manner. Remove the <quote>no</quote> if you want the
121old <command>vi</command> behavior. The <parameter>set
122backspace=2</parameter> allows backspacing over line breaks,
123autoindents, and the start of insert. The <parameter>syntax
124on</parameter> enables vim's syntax highlighting. Finally, the
125<parameter>if</parameter> statement with the <parameter>set
126background=dark</parameter> corrects <command>vim</command>'s guess
127about the background color of some terminal emulators. This gives the
128highlighting a better color scheme for use on the black background of
129these programs.</para>
130
131<para>Documentation for other available options can be obtained by
132running the following command:</para>
133
134<screen><userinput>vim -c ':options'</userinput></screen>
135
136</sect2>
137
138<sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
139
140<segmentedlist>
141<segtitle>Installed programs</segtitle>
142<seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
143pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
144view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
145vimtutor and xxd</seg></seglistitem>
146</segmentedlist>
147
148<variablelist><bridgehead renderas="sect3">Short descriptions</bridgehead>
149<?dbfo list-presentation="list"?>
150
151<varlistentry id="efm_filter.pl">
152<term><command>efm_filter.pl</command></term>
153<listitem>
154<para>a filter for creating an error file that can be read by <command>vim</command>.</para>
155<indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
156</listitem>
157</varlistentry>
158
159<varlistentry id="efm_perl.pl">
160<term><command>efm_perl.pl</command></term>
161<listitem>
162<para>reformats the error messages of the
163Perl interpreter for use with the <quote>quickfix</quote> mode of <command>vim</command>.</para>
164<indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
165</listitem>
166</varlistentry>
167
168<varlistentry id="ex">
169<term><command>ex</command></term>
170<listitem>
171<para>starts <command>vim</command> in ex mode.</para>
172<indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
173</listitem>
174</varlistentry>
175
176<varlistentry id="less.sh">
177<term><command>less.sh</command></term>
178<listitem>
179<para>a script that starts <command>vim</command> with less.vim.</para>
180<indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
181</listitem>
182</varlistentry>
183
184<varlistentry id="mve.awk">
185<term><command>mve.awk</command></term>
186<listitem>
187<para>processes <command>vim</command> errors.</para>
188<indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
189</listitem>
190</varlistentry>
191
192<varlistentry id="pltags.pl">
193<term><command>pltags.pl</command></term>
194<listitem>
195<para>creates a tags file for Perl code, for use by <command>vim</command>.</para>
196<indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
197</listitem>
198</varlistentry>
199
200<varlistentry id="ref">
201<term><command>ref</command></term>
202<listitem>
203<para>checks the spelling of arguments.</para>
204<indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
205</listitem>
206</varlistentry>
207
208<varlistentry id="rview">
209<term><command>rview</command></term>
210<listitem>
211<para>is a restricted version of <command>view</command>: no shell
212commands can be started and <command>view</command> cannot be suspended.</para>
213<indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
214</listitem>
215</varlistentry>
216
217<varlistentry id="rvim">
218<term><command>rvim</command></term>
219<listitem>
220<para>is a restricted version of <command>vim</command>: no shell
221commands can be started and <command>vim</command> cannot be suspended.</para>
222<indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
223</listitem>
224</varlistentry>
225
226<varlistentry id="shtags.pl">
227<term><command>shtags.pl</command></term>
228<listitem>
229<para>generates a tag file for Perl scripts.</para>
230<indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
231</listitem>
232</varlistentry>
233
234<varlistentry id="tcltags">
235<term><command>tcltags</command></term>
236<listitem>
237<para>generates a tag file for TCL code.</para>
238<indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
239</listitem>
240</varlistentry>
241
242<varlistentry id="view">
243<term><command>view</command></term>
244<listitem>
245<para>starts <command>vim</command> in read-only mode.</para>
246<indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
247</listitem>
248</varlistentry>
249
250<varlistentry id="vim">
251<term><command>vim</command></term>
252<listitem>
253<para>is the editor.</para>
254<indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
255</listitem>
256</varlistentry>
257
258<varlistentry id="vim132">
259<term><command>vim132</command></term>
260<listitem>
261<para>starts <command>vim</command> with the terminal in 132-column mode.</para>
262<indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
263</listitem>
264</varlistentry>
265
266<varlistentry id="vim2html.pl">
267<term><command>vim2html.pl</command></term>
268<listitem>
269<para>converts Vim documentation to HTML.</para>
270<indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
271</listitem>
272</varlistentry>
273
274<varlistentry id="vimdiff">
275<term><command>vimdiff</command></term>
276<listitem>
277<para>edits two or three versions of a file with <command>vim</command> and show differences.</para>
278<indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
279</listitem>
280</varlistentry>
281
282<varlistentry id="vimm">
283<term><command>vimm</command></term>
284<listitem>
285<para>enables the DEC locator input model on a remote terminal.</para>
286<indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
287</listitem>
288</varlistentry>
289
290<varlistentry id="vimspell.sh">
291<term><command>vimspell.sh</command></term>
292<listitem>
293<para>a script which spells a file and generates the syntax statements necessary
294to highlight in <command>vim</command>. This script requires the old Unix <command>spell</command>
295command, which is provided neither in LFS nor in BLFS.</para>
296<indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
297</listitem>
298</varlistentry>
299
300<varlistentry id="vimtutor">
301<term><command>vimtutor</command></term>
302<listitem>
303<para>teaches you the basic keys and commands of <command>vim</command>.</para>
304<indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
305</listitem>
306</varlistentry>
307
308<varlistentry id="xxd">
309<term><command>xxd</command></term>
310<listitem>
311<para>creates a hex dump of the given file. It can
312also do the reverse, so it can be used for binary patching.</para>
313<indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
314</listitem>
315</varlistentry>
316</variablelist>
317
318</sect2>
319
320</sect1>
321
Note: See TracBrowser for help on using the repository browser.