source: chapter06/vim.xml@ bc2136e

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 bc2136e was bc2136e, checked in by Archaic <archaic@…>, 19 years ago

Several minor grammatical fixes. Thanks to Randy and Steve.

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

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