source: chapter06/vim.xml@ 33d608d

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.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 33d608d was 33d608d, checked in by Bruce Dubbs <bdubbs@…>, 16 years ago

Remove unnecessary mandir patch. Updated vim package contents.

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

  • Property mode set to 100644
File size: 11.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-vim" role="wrap">
9 <?dbhtml filename="vim.html"?>
10
11 <sect1info condition="script">
12 <productname>vim</productname>
13 <productnumber>&vim-version;</productnumber>
14 <address>&vim-url;<otheraddr>&vim-lang-url;</otheraddr></address>
15 </sect1info>
16
17 <title>Vim-&vim-version;</title>
18
19 <indexterm zone="ch-system-vim">
20 <primary sortas="a-Vim">Vim</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Vim package contains a powerful text editor.</para>
27
28 <segmentedlist>
29 <segtitle>&buildtime;</segtitle>
30 <segtitle>&diskspace;</segtitle>
31
32 <seglistitem>
33 <seg>&vim-ch6-sbu;</seg>
34 <seg>&vim-ch6-du;</seg>
35 </seglistitem>
36 </segmentedlist>
37
38 <tip>
39 <title>Alternatives to Vim</title>
40
41 <para>If you prefer another editor&mdash;such as Emacs, Joe, or
42 Nano&mdash;please refer to <ulink
43 url="&blfs-root;view/svn/postlfs/editors.html"/> for suggested
44 installation instructions.</para>
45 </tip>
46
47 </sect2>
48
49 <sect2 role="installation">
50 <title>Installation of Vim</title>
51
52 <para>First, unpack both
53 <filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
54 <filename>vim-&vim-version;-lang.tar.gz</filename> archives into the
55 same directory.</para>
56
57 <para>Apply a patch which fixes various issues already found and fixed by
58 the upstream maintainers since the inital release of Vim-&vim-version;:
59 </para>
60
61<screen><userinput remap="pre">patch -Np1 -i ../&vim-fixes-patch;</userinput></screen>
62
63<!--
64 <para>This version of Vim installs translated man pages and places
65 them into directories that will not be searched by Man-DB. Patch Vim
66 so that it installs its man pages into searchable directories and
67 ultimately allows Man-DB to transcode the page into the desired format
68 at run-time:</para>
69
70<screen><userinput remap="pre">patch -Np1 -i ../&vim-mandir-patch;</userinput></screen>
71-->
72 <para>Change the default location of the
73 <filename>vimrc</filename> configuration file to <filename
74 class="directory">/etc</filename>:</para>
75
76<screen><userinput remap="pre">echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
77
78 <para>Now prepare Vim for compilation:</para>
79
80<screen><userinput remap="configure">./configure --prefix=/usr --enable-multibyte</userinput></screen>
81
82 <variablelist>
83 <title>The meaning of the configure options:</title>
84
85 <varlistentry>
86 <term><parameter>--enable-multibyte</parameter></term>
87 <listitem>
88 <para>This switch enables support for editing files in multibyte
89 character encodings. This is needed if using a locale with a
90 multibyte character set. This switch is also helpful to be able
91 to edit text files initially created in Linux distributions like
92 Fedora Core that use UTF-8 as a default character set.</para>
93 </listitem>
94 </varlistentry>
95
96 </variablelist>
97
98 <para>Compile the package:</para>
99
100<screen><userinput remap="make">make</userinput></screen>
101
102 <para>To test the results, issue:</para>
103
104<screen><userinput remap="test">make test</userinput></screen>
105
106 <para>However, this test suite outputs a lot of binary data to the screen,
107 which can cause issues with the settings of the current terminal. This can
108 be resolved by redirecting the output to a log file.</para>
109
110 <para>Install the package:</para>
111
112<screen><userinput remap="install">make install</userinput></screen>
113
114 <para>Many users are used to using <command>vi</command> instead of
115 <command>vim</command>. To allow execution of <command>vim</command>
116 when users habitually enter <command>vi</command>, create a
117 symlink for both the binary and the man page in the provided
118 languages:</para>
119
120<screen><userinput remap="install">ln -sv vim /usr/bin/vi
121for L in "" fr it pl ru; do
122 ln -sv vim.1 /usr/share/man/$L/man1/vi.1
123done</userinput></screen>
124
125 <para>By default, Vim's documentation is installed in <filename
126 class="directory">/usr/share/vim</filename>. The following symlink
127 allows the documentation to be accessed via <filename
128 class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
129 it consistent with the location of documentation for other packages:</para>
130
131<screen><userinput remap="install">ln -sv ../&vim-docdir;/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
132
133 <para>If an X Window System is going to be installed on the LFS
134 system, it may be necessary to recompile Vim after installing X. Vim
135 comes with a GUI version of the editor that requires X and some
136 additional libraries to be installed. For more information on this
137 process, refer to the Vim documentation and the Vim installation page
138 in the BLFS book at <ulink
139 url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
140
141 </sect2>
142
143 <sect2 id="conf-vim" role="configuration">
144 <title>Configuring Vim</title>
145
146 <indexterm zone="conf-vim">
147 <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
148 </indexterm>
149
150 <para>By default, <command>vim</command> runs in vi-incompatible mode.
151 This may be new to users who have used other editors in the past. The
152 <quote>nocompatible</quote> setting is included below to highlight the
153 fact that a new behavior is being used. It also reminds those who would
154 change to <quote>compatible</quote> mode that it should be the first
155 setting in the configuration file. This is necessary because it changes
156 other settings, and overrides must come after this setting. Create a default
157 <command>vim</command> configuration file by running the following:</para>
158
159<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
160<literal>" Begin /etc/vimrc
161
162set nocompatible
163set backspace=2
164syntax on
165if (&amp;term == "iterm") || (&amp;term == "putty")
166 set background=dark
167endif
168
169" End /etc/vimrc</literal>
170EOF</userinput></screen>
171
172 <para>The <parameter>set nocompatible</parameter> setting makes
173 <command>vim</command> behave in a more useful way (the default) than
174 the vi-compatible manner. Remove the <quote>no</quote> to keep the
175 old <command>vi</command> behavior. The <parameter>set
176 backspace=2</parameter> setting allows backspacing over line breaks,
177 autoindents, and the start of insert. The <parameter>syntax
178 on</parameter> parameter enables vim's syntax highlighting. Finally,
179 the <emphasis>if</emphasis> statement with the <parameter>set
180 background=dark</parameter> setting corrects <command>vim</command>'s
181 guess about the background color of some terminal emulators. This
182 gives the highlighting a better color scheme for use on the black
183 background of these programs.</para>
184
185 <para>Documentation for other available options can be obtained by
186 running the following command:</para>
187
188<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
189
190 <note>
191 <para>By default, Vim only installs spell files for the English language.
192 To install spell files for your preferred language, download the
193 <filename>*.spl</filename> and optionally, the <filename>*.sug</filename>
194 files for your language and character encoding from <ulink
195 url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save them to
196 <filename class='directory'>/usr/share/&vim-docdir;/spell/</filename>.</para>
197
198 <para>To use these spell files, some configuration in
199 <filename>/etc/vimrc</filename> is needed, e.g.:</para>
200
201<screen><literal>set spelllang=en,ru
202set spell</literal></screen>
203
204 <para>For more information, see the appropriate README file located
205 at the URL above.</para>
206 </note>
207
208 </sect2>
209
210 <sect2 id="contents-vim" role="content">
211 <title>Contents of Vim</title>
212
213 <segmentedlist>
214 <segtitle>Installed programs</segtitle>
215
216 <seglistitem>
217 <seg>ex (link to vim), rview (link to vim), rvim (link to vim),
218 vi (link to vim), view (link to vim), vim,
219 vimdiff (link to vim), vimtutor, and xxd</seg>
220 </seglistitem>
221 </segmentedlist>
222
223 <variablelist>
224 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
225 <?dbfo list-presentation="list"?>
226 <?dbhtml list-presentation="table"?>
227
228 <varlistentry id="ex">
229 <term><command>ex</command></term>
230 <listitem>
231 <para>Starts <command>vim</command> in ex mode</para>
232 <indexterm zone="ch-system-vim ex">
233 <primary sortas="b-ex">ex</primary>
234 </indexterm>
235 </listitem>
236 </varlistentry>
237
238 <varlistentry id="rview">
239 <term><command>rview</command></term>
240 <listitem>
241 <para>Is a restricted version of <command>view</command>; no shell
242 commands can be started and <command>view</command> cannot be
243 suspended</para>
244 <indexterm zone="ch-system-vim rview">
245 <primary sortas="b-rview">rview</primary>
246 </indexterm>
247 </listitem>
248 </varlistentry>
249
250 <varlistentry id="rvim">
251 <term><command>rvim</command></term>
252 <listitem>
253 <para>Is a restricted version of <command>vim</command>; no shell
254 commands can be started and <command>vim</command> cannot be
255 suspended</para>
256 <indexterm zone="ch-system-vim rvim">
257 <primary sortas="b-rvim">rvim</primary>
258 </indexterm>
259 </listitem>
260 </varlistentry>
261
262 <varlistentry id="vi">
263 <term><command>vi</command></term>
264 <listitem>
265 <para>Link to <command>vim</command></para>
266 <indexterm zone="ch-system-vim vi">
267 <primary sortas="b-vi">vi</primary>
268 </indexterm>
269 </listitem>
270 </varlistentry>
271
272 <varlistentry id="view">
273 <term><command>view</command></term>
274 <listitem>
275 <para>Starts <command>vim</command> in read-only mode</para>
276 <indexterm zone="ch-system-vim view">
277 <primary sortas="b-view">view</primary>
278 </indexterm>
279 </listitem>
280 </varlistentry>
281
282 <varlistentry id="vim">
283 <term><command>vim</command></term>
284 <listitem>
285 <para>Is the editor</para>
286 <indexterm zone="ch-system-vim vim">
287 <primary sortas="b-vim">vim</primary>
288 </indexterm>
289 </listitem>
290 </varlistentry>
291
292 <varlistentry id="vimdiff">
293 <term><command>vimdiff</command></term>
294 <listitem>
295 <para>Edits two or three versions of a file with <command>vim</command>
296 and show differences</para>
297 <indexterm zone="ch-system-vim vimdiff">
298 <primary sortas="b-vimdiff">vimdiff</primary>
299 </indexterm>
300 </listitem>
301 </varlistentry>
302
303 <varlistentry id="vimtutor">
304 <term><command>vimtutor</command></term>
305 <listitem>
306 <para>Teaches the basic keys and commands of
307 <command>vim</command></para>
308 <indexterm zone="ch-system-vim vimtutor">
309 <primary sortas="b-vimtutor">vimtutor</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
314 <varlistentry id="xxd">
315 <term><command>xxd</command></term>
316 <listitem>
317 <para>Creates a hex dump of the given file; it can
318 also do the reverse, so it can be used for binary patching</para>
319 <indexterm zone="ch-system-vim xxd">
320 <primary sortas="b-xxd">xxd</primary>
321 </indexterm>
322 </listitem>
323 </varlistentry>
324
325 </variablelist>
326
327 </sect2>
328
329</sect1>
Note: See TracBrowser for help on using the repository browser.