source: chapter06/vim.xml@ f8d484d

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 f8d484d was f8d484d, checked in by Matthew Burgess <matthew@…>, 18 years ago

Symlink Vim's documentation to /usr/share/doc/vim-6.4

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

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