source: chapter06/vim.xml@ ca17032

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since ca17032 was ca17032, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Including patches.ent from general.ent

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

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