source: chapter06/vim.xml@ 232779f8

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 7.4 7.5 7.6 7.7 7.8 7.9 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 232779f8 was 232779f8, checked in by Bruce Dubbs <bdubbs@…>, 11 years ago

Update to vim-7.4

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

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