source: chapter08/vim.xml@ fb386e0

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 ml-11.0 multilib trunk xry111/git-transition xry111/glibc-2.34 xry111/tester-nohack xry111/usr-move
Last change on this file since fb386e0 was fb386e0, checked in by Thomas Trepl <thomas@…>, 18 months ago

Rename package entities to be independent of chapter numbering

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11921 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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