source: chapter06/vim.xml@ 7862089

Last change on this file since 7862089 was a0e1913, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Removed the package name from the dependencies titles.

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

  • Property mode set to 100644
File size: 11.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-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>&dependencies;</segtitle>
23<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
24GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem>
25</segmentedlist>
26
27<tip>
28<title>Alternatives to Vim</title>
29<para>If you prefer another editor&mdash;such as Emacs, Joe, or
30Nano&mdash;please refer to <ulink url="&blfs-root;view/svn/postlfs/editors.html"/>
31for suggested 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 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
66<para>To test the results, 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 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 users 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 recompile 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 and the Vim installation page
88in the BLFS book at <ulink
89url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</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 <command>vim</command>
103configuration file by running the following:</para>
104
105<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
106<literal>" 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</literal>
116EOF</userinput></screen>
117
118
119<para>The <parameter>set nocompatible</parameter> makes
120<command>vim</command> behave in a more useful way (the default) than
121the vi-compatible manner. Remove the <quote>no</quote> to keep the
122old <command>vi</command> behavior. The <parameter>set
123backspace=2</parameter> allows backspacing over line breaks,
124autoindents, and the start of insert. The <parameter>syntax
125on</parameter> enables vim's syntax highlighting. Finally, the
126<emphasis>if</emphasis> statement with the <parameter>set
127background=dark</parameter> corrects <command>vim</command>'s guess
128about the background color of some terminal emulators. This gives the
129highlighting a better color scheme for use on the black background of
130these programs.</para>
131
132<para>Documentation for other available options can be obtained by
133running the following command:</para>
134
135<screen><userinput>vim -c ':options'</userinput></screen>
136
137</sect2>
138
139<sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
140
141<segmentedlist>
142<segtitle>Installed programs</segtitle>
143<seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
144pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
145view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
146vimtutor, and xxd</seg></seglistitem>
147</segmentedlist>
148
149<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
150<?dbfo list-presentation="list"?>
151<?dbhtml list-presentation="table"?>
152
153<varlistentry id="efm_filter.pl">
154<term><command>efm_filter.pl</command></term>
155<listitem>
156<para>A filter for creating an error file that can be read by <command>vim</command></para>
157<indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
158</listitem>
159</varlistentry>
160
161<varlistentry id="efm_perl.pl">
162<term><command>efm_perl.pl</command></term>
163<listitem>
164<para>Reformats the error messages of the
165Perl interpreter for use with the <quote>quickfix</quote> mode of <command>vim</command></para>
166<indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
167</listitem>
168</varlistentry>
169
170<varlistentry id="ex">
171<term><command>ex</command></term>
172<listitem>
173<para>Starts <command>vim</command> in ex mode</para>
174<indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
175</listitem>
176</varlistentry>
177
178<varlistentry id="less.sh">
179<term><command>less.sh</command></term>
180<listitem>
181<para>A script that starts <command>vim</command> with less.vim</para>
182<indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
183</listitem>
184</varlistentry>
185
186<varlistentry id="mve.awk">
187<term><command>mve.awk</command></term>
188<listitem>
189<para>Processes <command>vim</command> errors</para>
190<indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
191</listitem>
192</varlistentry>
193
194<varlistentry id="pltags.pl">
195<term><command>pltags.pl</command></term>
196<listitem>
197<para>Creates a tags file for Perl code for use by <command>vim</command></para>
198<indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
199</listitem>
200</varlistentry>
201
202<varlistentry id="ref">
203<term><command>ref</command></term>
204<listitem>
205<para>Checks the spelling of arguments</para>
206<indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
207</listitem>
208</varlistentry>
209
210<varlistentry id="rview">
211<term><command>rview</command></term>
212<listitem>
213<para>Is a restricted version of <command>view</command>; no shell
214commands can be started and <command>view</command> cannot be suspended</para>
215<indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
216</listitem>
217</varlistentry>
218
219<varlistentry id="rvim">
220<term><command>rvim</command></term>
221<listitem>
222<para>Is a restricted version of <command>vim</command>; no shell
223commands can be started and <command>vim</command> cannot be suspended</para>
224<indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
225</listitem>
226</varlistentry>
227
228<varlistentry id="shtags.pl">
229<term><command>shtags.pl</command></term>
230<listitem>
231<para>Generates a tag file for Perl scripts</para>
232<indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
233</listitem>
234</varlistentry>
235
236<varlistentry id="tcltags">
237<term><command>tcltags</command></term>
238<listitem>
239<para>Generates a tag file for TCL code</para>
240<indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
241</listitem>
242</varlistentry>
243
244<varlistentry id="view">
245<term><command>view</command></term>
246<listitem>
247<para>Starts <command>vim</command> in read-only mode</para>
248<indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
249</listitem>
250</varlistentry>
251
252<varlistentry id="vi">
253<term><command>vi</command></term>
254<listitem>
255<para>Is the editor</para>
256<indexterm zone="ch-system-vim vi"><primary sortas="b-vi">vi</primary></indexterm>
257</listitem>
258</varlistentry>
259
260<varlistentry id="vim">
261<term><command>vim</command></term>
262<listitem>
263<para>Is the editor</para>
264<indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
265</listitem>
266</varlistentry>
267
268<varlistentry id="vim132">
269<term><command>vim132</command></term>
270<listitem>
271<para>Starts <command>vim</command> with the terminal in 132-column mode</para>
272<indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
273</listitem>
274</varlistentry>
275
276<varlistentry id="vim2html.pl">
277<term><command>vim2html.pl</command></term>
278<listitem>
279<para>Converts Vim documentation to HypterText Markup Language (HTML)</para>
280<indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
281</listitem>
282</varlistentry>
283
284<varlistentry id="vimdiff">
285<term><command>vimdiff</command></term>
286<listitem>
287<para>Edits two or three versions of a file with <command>vim</command> and show differences</para>
288<indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
289</listitem>
290</varlistentry>
291
292<varlistentry id="vimm">
293<term><command>vimm</command></term>
294<listitem>
295<para>Enables the DEC locator input model on a remote terminal</para>
296<indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
297</listitem>
298</varlistentry>
299
300<varlistentry id="vimspell.sh">
301<term><command>vimspell.sh</command></term>
302<listitem>
303<para>Spells a file and generates the syntax statements necessary
304to highlight in <command>vim</command>. This script requires the old Unix <command>spell</command>
305command, which is provided neither in LFS nor in BLFS</para>
306<indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
307</listitem>
308</varlistentry>
309
310<varlistentry id="vimtutor">
311<term><command>vimtutor</command></term>
312<listitem>
313<para>Teaches the basic keys and commands of <command>vim</command></para>
314<indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
315</listitem>
316</varlistentry>
317
318<varlistentry id="xxd">
319<term><command>xxd</command></term>
320<listitem>
321<para>Creates a hex dump of the given file; it can
322also do the reverse, so it can be used for binary patching</para>
323<indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
324</listitem>
325</varlistentry>
326</variablelist>
327
328</sect2>
329
330</sect1>
331
Note: See TracBrowser for help on using the repository browser.