source: chapter06/vim.xml@ ed8ff7d

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

Remove the Vim fixes patch. Fixes #2597.

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

  • Property mode set to 100644
File size: 11.0 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>Change the default location of the
58 <filename>vimrc</filename> configuration file to <filename
59 class="directory">/etc</filename>:</para>
60
61<screen><userinput remap="pre">echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
62
63 <para>Now prepare Vim for compilation:</para>
64
65<screen><userinput remap="configure">./configure --prefix=/usr --enable-multibyte</userinput></screen>
66
67 <variablelist>
68 <title>The meaning of the configure options:</title>
69
70 <varlistentry>
71 <term><parameter>--enable-multibyte</parameter></term>
72 <listitem>
73 <para>This switch enables support for editing files in multibyte
74 character encodings. This is needed if using a locale with a
75 multibyte character set. This switch is also helpful to be able
76 to edit text files initially created in Linux distributions like
77 Fedora that use UTF-8 as a default character set.</para>
78 </listitem>
79 </varlistentry>
80
81 </variablelist>
82
83 <para>Compile the package:</para>
84
85<screen><userinput remap="make">make</userinput></screen>
86
87 <para>To test the results, issue:</para>
88
89<screen><userinput remap="test">make test</userinput></screen>
90
91 <para>However, this test suite outputs a lot of binary data to the screen,
92 which can cause issues with the settings of the current terminal. This can
93 be resolved by redirecting the output to a log file.</para>
94
95 <para>Install the package:</para>
96
97<screen><userinput remap="install">make install</userinput></screen>
98
99 <para>Many users are used to using <command>vi</command> instead of
100 <command>vim</command>. To allow execution of <command>vim</command>
101 when users habitually enter <command>vi</command>, create a
102 symlink for both the binary and the man page in the provided
103 languages:</para>
104
105<screen><userinput remap="install">ln -sv vim /usr/bin/vi
106for L in /usr/share/man/{,*/}man1/vim.1; do
107 ln -sv vim.1 $(dirname $L)/vi.1
108done</userinput></screen>
109
110 <para>By default, Vim's documentation is installed in <filename
111 class="directory">/usr/share/vim</filename>. The following symlink
112 allows the documentation to be accessed via <filename
113 class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
114 it consistent with the location of documentation for other packages:</para>
115
116<screen><userinput remap="install">ln -sv ../&vim-docdir;/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
117
118 <para>If an X Window System is going to be installed on the LFS
119 system, it may be necessary to recompile Vim after installing X. Vim
120 comes with a GUI version of the editor that requires X and some
121 additional libraries to be installed. For more information on this
122 process, refer to the Vim documentation and the Vim installation page
123 in the BLFS book at <ulink
124 url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
125
126 </sect2>
127
128 <sect2 id="conf-vim" role="configuration">
129 <title>Configuring Vim</title>
130
131 <indexterm zone="conf-vim">
132 <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
133 </indexterm>
134
135 <para>By default, <command>vim</command> runs in vi-incompatible mode.
136 This may be new to users who have used other editors in the past. The
137 <quote>nocompatible</quote> setting is included below to highlight the
138 fact that a new behavior is being used. It also reminds those who would
139 change to <quote>compatible</quote> mode that it should be the first
140 setting in the configuration file. This is necessary because it changes
141 other settings, and overrides must come after this setting. Create a default
142 <command>vim</command> configuration file by running the following:</para>
143
144<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
145<literal>" Begin /etc/vimrc
146
147set nocompatible
148set backspace=2
149syntax on
150if (&amp;term == "iterm") || (&amp;term == "putty")
151 set background=dark
152endif
153
154" End /etc/vimrc</literal>
155EOF</userinput></screen>
156
157 <para>The <parameter>set nocompatible</parameter> setting makes
158 <command>vim</command> behave in a more useful way (the default) than
159 the vi-compatible manner. Remove the <quote>no</quote> to keep the
160 old <command>vi</command> behavior. The <parameter>set
161 backspace=2</parameter> setting allows backspacing over line breaks,
162 autoindents, and the start of insert. The <parameter>syntax
163 on</parameter> parameter enables vim's syntax highlighting. Finally,
164 the <emphasis>if</emphasis> statement with the <parameter>set
165 background=dark</parameter> setting corrects <command>vim</command>'s
166 guess about the background color of some terminal emulators. This
167 gives the highlighting a better color scheme for use on the black
168 background of these programs.</para>
169
170 <para>Documentation for other available options can be obtained by
171 running the following command:</para>
172
173<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
174
175 <note>
176 <para>By default, Vim only installs spell files for the English language.
177 To install spell files for your preferred language, download the
178 <filename>*.spl</filename> and optionally, the <filename>*.sug</filename>
179 files for your language and character encoding from <ulink
180 url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save them to
181 <filename class='directory'>/usr/share/&vim-docdir;/spell/</filename>.</para>
182
183 <para>To use these spell files, some configuration in
184 <filename>/etc/vimrc</filename> is needed, e.g.:</para>
185
186<screen><literal>set spelllang=en,ru
187set spell</literal></screen>
188
189 <para>For more information, see the appropriate README file located
190 at the URL above.</para>
191 </note>
192
193 </sect2>
194
195 <sect2 id="contents-vim" role="content">
196 <title>Contents of Vim</title>
197
198 <segmentedlist>
199 <segtitle>Installed programs</segtitle>
200
201 <seglistitem>
202 <seg>ex (link to vim), rview (link to vim), rvim (link to vim),
203 vi (link to vim), view (link to vim), vim,
204 vimdiff (link to vim), vimtutor, and xxd</seg>
205 </seglistitem>
206 </segmentedlist>
207
208 <variablelist>
209 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
210 <?dbfo list-presentation="list"?>
211 <?dbhtml list-presentation="table"?>
212
213 <varlistentry id="ex">
214 <term><command>ex</command></term>
215 <listitem>
216 <para>Starts <command>vim</command> in ex mode</para>
217 <indexterm zone="ch-system-vim ex">
218 <primary sortas="b-ex">ex</primary>
219 </indexterm>
220 </listitem>
221 </varlistentry>
222
223 <varlistentry id="rview">
224 <term><command>rview</command></term>
225 <listitem>
226 <para>Is a restricted version of <command>view</command>; no shell
227 commands can be started and <command>view</command> cannot be
228 suspended</para>
229 <indexterm zone="ch-system-vim rview">
230 <primary sortas="b-rview">rview</primary>
231 </indexterm>
232 </listitem>
233 </varlistentry>
234
235 <varlistentry id="rvim">
236 <term><command>rvim</command></term>
237 <listitem>
238 <para>Is a restricted version of <command>vim</command>; no shell
239 commands can be started and <command>vim</command> cannot be
240 suspended</para>
241 <indexterm zone="ch-system-vim rvim">
242 <primary sortas="b-rvim">rvim</primary>
243 </indexterm>
244 </listitem>
245 </varlistentry>
246
247 <varlistentry id="vi">
248 <term><command>vi</command></term>
249 <listitem>
250 <para>Link to <command>vim</command></para>
251 <indexterm zone="ch-system-vim vi">
252 <primary sortas="b-vi">vi</primary>
253 </indexterm>
254 </listitem>
255 </varlistentry>
256
257 <varlistentry id="view">
258 <term><command>view</command></term>
259 <listitem>
260 <para>Starts <command>vim</command> in read-only mode</para>
261 <indexterm zone="ch-system-vim view">
262 <primary sortas="b-view">view</primary>
263 </indexterm>
264 </listitem>
265 </varlistentry>
266
267 <varlistentry id="vim">
268 <term><command>vim</command></term>
269 <listitem>
270 <para>Is the editor</para>
271 <indexterm zone="ch-system-vim vim">
272 <primary sortas="b-vim">vim</primary>
273 </indexterm>
274 </listitem>
275 </varlistentry>
276
277 <varlistentry id="vimdiff">
278 <term><command>vimdiff</command></term>
279 <listitem>
280 <para>Edits two or three versions of a file with <command>vim</command>
281 and show differences</para>
282 <indexterm zone="ch-system-vim vimdiff">
283 <primary sortas="b-vimdiff">vimdiff</primary>
284 </indexterm>
285 </listitem>
286 </varlistentry>
287
288 <varlistentry id="vimtutor">
289 <term><command>vimtutor</command></term>
290 <listitem>
291 <para>Teaches the basic keys and commands of
292 <command>vim</command></para>
293 <indexterm zone="ch-system-vim vimtutor">
294 <primary sortas="b-vimtutor">vimtutor</primary>
295 </indexterm>
296 </listitem>
297 </varlistentry>
298
299 <varlistentry id="xxd">
300 <term><command>xxd</command></term>
301 <listitem>
302 <para>Creates a hex dump of the given file; it can
303 also do the reverse, so it can be used for binary patching</para>
304 <indexterm zone="ch-system-vim xxd">
305 <primary sortas="b-xxd">xxd</primary>
306 </indexterm>
307 </listitem>
308 </varlistentry>
309
310 </variablelist>
311
312 </sect2>
313
314</sect1>
Note: See TracBrowser for help on using the repository browser.