source: chapter06/vim.xml@ fc294857

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 fc294857 was fc294857, checked in by Pierre Labastie <pieere@…>, 7 years ago

Add missing sect1info in vim

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