source: chapter06/vim.xml@ 1c7cb2d

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 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 1c7cb2d was 1c7cb2d, checked in by Bruce Dubbs <bdubbs@…>, 7 years ago

Add a comment about a vim test failure

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

  • Property mode set to 100644
File size: 10.3 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
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>
[e4a5635]27 <seg>&vim-ch6-sbu;</seg>
28 <seg>&vim-ch6-du;</seg>
[ddd5542]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
[0ee07e5]37 url="&blfs-book;postlfs/editors.html"/> for suggested
[ddd5542]38 installation instructions.</para>
39 </tip>
40
41 </sect2>
42
43 <sect2 role="installation">
44 <title>Installation of Vim</title>
45
[0720a4e]46 <para>First, change the default location of the <filename>vimrc</filename>
47 configuration file to <filename class="directory">/etc</filename>:</para>
[73aedd1d]48
[0445a3d]49<screen><userinput remap="pre">echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
[0720a4e]50
[232779f8]51 <para>Prepare Vim for compilation:</para>
[73aedd1d]52
[254c03be]53<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
[81fd230]54
[ddd5542]55 <para>Compile the package:</para>
[73aedd1d]56
[0445a3d]57<screen><userinput remap="make">make</userinput></screen>
[73aedd1d]58
[0445a3d]59 <para>To test the results, issue:</para>
60
[3aee2ac2]61<screen><userinput remap="test">make -j1 test</userinput></screen>
[0445a3d]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
[5dbeba9]65 be resolved by redirecting the output to a log file. A successful test
[1c7cb2d]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>
[1a73ed4]68
[ddd5542]69 <para>Install the package:</para>
[73aedd1d]70
[0d81e3c]71<screen><userinput remap="install">make install</userinput></screen>
[73aedd1d]72
[ddd5542]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
[cd2f7f0]76 symlink for both the binary and the man page in the provided
77 languages:</para>
[73aedd1d]78
[0445a3d]79<screen><userinput remap="install">ln -sv vim /usr/bin/vi
[e54882e]80for L in /usr/share/man/{,*/}man1/vim.1; do
81 ln -sv vim.1 $(dirname $L)/vi.1
[cd2f7f0]82done</userinput></screen>
[73aedd1d]83
[0d81e3c]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
[ddd5542]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
[0ee07e5]98 url="&blfs-book;postlfs/vim.html"/>.</para>
[0ba2766b]99
[ddd5542]100 </sect2>
[342b176]101
[ddd5542]102 <sect2 id="conf-vim" role="configuration">
103 <title>Configuring Vim</title>
[3f0c882]104
[ddd5542]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>
[342b176]117
[8ad7980]118<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
[d72e04a]119<literal>" Begin /etc/vimrc
[342b176]120
121set nocompatible
122set backspace=2
[8557cab]123set mouse=r
[342b176]124syntax on
[4032ec9c]125if (&amp;term == "xterm") || (&amp;term == "putty")
[3e05705]126 set background=dark
127endif
[342b176]128
[8557cab]129
[d72e04a]130" End /etc/vimrc</literal>
[8ad7980]131EOF</userinput></screen>
[342b176]132
[92e51a3]133 <para>The <parameter>set nocompatible</parameter> setting makes
[8557cab]134 <command>vim</command> behave in a more useful way (the default) than the
135 vi-compatible manner. Remove the <quote>no</quote> to keep the old
136 <command>vi</command> behavior. The <parameter>set backspace=2</parameter>
137 setting allows backspacing over line breaks, autoindents, and the start of
138 insert. The <parameter>syntax on</parameter> parameter enables vim's syntax
139 highlighting. The <parameter>set mouse=r</parameter> setting enables
140 proper pasting of text with the mouse when working in chroot or over a
141 remote connection. Finally, the <emphasis>if</emphasis> statement with the
142 <parameter>set background=dark</parameter> setting corrects
143 <command>vim</command>'s guess about the background color of some terminal
144 emulators. This gives the highlighting a better color scheme for use on the
145 black background of these programs.</para>
[ddd5542]146
147 <para>Documentation for other available options can be obtained by
148 running the following command:</para>
[dc32fef]149
[de92788]150<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
[dc32fef]151
[a1a0a65]152 <note>
153 <para>By default, Vim only installs spell files for the English language.
[c226182]154 To install spell files for your preferred language, download the
155 <filename>*.spl</filename> and optionally, the <filename>*.sug</filename>
156 files for your language and character encoding from <ulink
[92e51a3]157 url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save them to
[5111cd5]158 <filename class='directory'>/usr/share/&vim-docdir;/spell/</filename>.</para>
[c226182]159
160 <para>To use these spell files, some configuration in
161 <filename>/etc/vimrc</filename> is needed, e.g.:</para>
162
163<screen><literal>set spelllang=en,ru
164set spell</literal></screen>
165
166 <para>For more information, see the appropriate README file located
[92e51a3]167 at the URL above.</para>
[a1a0a65]168 </note>
169
[ddd5542]170 </sect2>
171
172 <sect2 id="contents-vim" role="content">
173 <title>Contents of Vim</title>
174
175 <segmentedlist>
176 <segtitle>Installed programs</segtitle>
[0d81e3c]177 <segtitle>Installed directory</segtitle>
[ddd5542]178
179 <seglistitem>
[9a483b2]180 <seg> ex (link to vim), rview (link to vim), rvim (link to vim), vi
181 (link to vim), view (link to vim), vim, vimdiff (link to vim), vimtutor,
182 and xxd</seg>
[0d81e3c]183 <seg>/usr/share/vim</seg>
[ddd5542]184 </seglistitem>
185 </segmentedlist>
186
187 <variablelist>
188 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
189 <?dbfo list-presentation="list"?>
190 <?dbhtml list-presentation="table"?>
191
192 <varlistentry id="ex">
193 <term><command>ex</command></term>
194 <listitem>
195 <para>Starts <command>vim</command> in ex mode</para>
196 <indexterm zone="ch-system-vim ex">
197 <primary sortas="b-ex">ex</primary>
198 </indexterm>
199 </listitem>
200 </varlistentry>
201
202 <varlistentry id="rview">
203 <term><command>rview</command></term>
204 <listitem>
205 <para>Is a restricted version of <command>view</command>; no shell
206 commands can be started and <command>view</command> cannot be
207 suspended</para>
208 <indexterm zone="ch-system-vim rview">
209 <primary sortas="b-rview">rview</primary>
210 </indexterm>
211 </listitem>
212 </varlistentry>
213
214 <varlistentry id="rvim">
215 <term><command>rvim</command></term>
216 <listitem>
217 <para>Is a restricted version of <command>vim</command>; no shell
218 commands can be started and <command>vim</command> cannot be
219 suspended</para>
220 <indexterm zone="ch-system-vim rvim">
221 <primary sortas="b-rvim">rvim</primary>
222 </indexterm>
223 </listitem>
224 </varlistentry>
225
[2791a8e]226 <varlistentry id="vi">
227 <term><command>vi</command></term>
[ddd5542]228 <listitem>
[2791a8e]229 <para>Link to <command>vim</command></para>
230 <indexterm zone="ch-system-vim vi">
231 <primary sortas="b-vi">vi</primary>
[ddd5542]232 </indexterm>
233 </listitem>
234 </varlistentry>
235
236 <varlistentry id="view">
237 <term><command>view</command></term>
238 <listitem>
239 <para>Starts <command>vim</command> in read-only mode</para>
240 <indexterm zone="ch-system-vim view">
241 <primary sortas="b-view">view</primary>
242 </indexterm>
243 </listitem>
244 </varlistentry>
245
246 <varlistentry id="vim">
247 <term><command>vim</command></term>
248 <listitem>
249 <para>Is the editor</para>
250 <indexterm zone="ch-system-vim vim">
251 <primary sortas="b-vim">vim</primary>
252 </indexterm>
253 </listitem>
254 </varlistentry>
255
256 <varlistentry id="vimdiff">
257 <term><command>vimdiff</command></term>
258 <listitem>
259 <para>Edits two or three versions of a file with <command>vim</command>
260 and show differences</para>
261 <indexterm zone="ch-system-vim vimdiff">
262 <primary sortas="b-vimdiff">vimdiff</primary>
263 </indexterm>
264 </listitem>
265 </varlistentry>
266
267 <varlistentry id="vimtutor">
268 <term><command>vimtutor</command></term>
269 <listitem>
270 <para>Teaches the basic keys and commands of
271 <command>vim</command></para>
272 <indexterm zone="ch-system-vim vimtutor">
273 <primary sortas="b-vimtutor">vimtutor</primary>
274 </indexterm>
275 </listitem>
276 </varlistentry>
277
278 <varlistentry id="xxd">
279 <term><command>xxd</command></term>
280 <listitem>
281 <para>Creates a hex dump of the given file; it can
282 also do the reverse, so it can be used for binary patching</para>
283 <indexterm zone="ch-system-vim xxd">
284 <primary sortas="b-xxd">xxd</primary>
285 </indexterm>
286 </listitem>
287 </varlistentry>
288
289 </variablelist>
290
291 </sect2>
[673b0d8]292
293</sect1>
Note: See TracBrowser for help on using the repository browser.