source: chapter08/vim.xml@ 1dcfd50

xry111/arm64 xry111/arm64-12.0
Last change on this file since 1dcfd50 was 9d3ba7b, checked in by Xi Ruoyao <xry111@…>, 21 months ago

vim: no need to download spell files

They are already in the tarball, so just install them if needed.

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