source: chapter06/vim.xml@ 5897639

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 8.1 8.1-rc1 8.1-rc2 8.2 8.2-rc1 8.3 8.3-rc1 8.3-rc2 8.4 8.4-rc1 9.0 9.0-rc1 9.1 9.1-rc1 cross-chap5 ml-11.0 multilib old-trunk trunk xry111/git-transition xry111/glibc-2.34 xry111/tester-nohack xry111/usr-move
Last change on this file since 5897639 was 5897639, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Fix a problem with glibc tests and add some explanations to i
the configure options.

Add a command to touch /root/.vimrc so that the default vim
options don't override those in /etc/vimrc.

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

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